<template> <div> <el-button mb-2 @click="toggle">Switch Language</el-button> <br /> <el-config-provider :locale="locale"> <el-table mb-1 :data="[]" /> <el-pagination :total="100" /> </el-config-provider> </div> </template> <script lang="ts" setup> import { computed, ref } from 'vue' import zhCn from 'element-plus/dist/locale/zh-cn.mjs' import en from 'element-plus/dist/locale/en.mjs' const language = ref('zh-cn') const locale = computed(() => (language.value === 'zh-cn' ? zhCn : en)) const toggle = () => { language.value = language.value === 'zh-cn' ? 'en' : 'zh-cn' } </script> 查看代码,分析locale和computed的作用,并告诉我他们的用法
相关推荐






<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
.bg-f4f6f7 {
background-color: #f4f6f7;
}
</style>
</head>
<body>
Æon
管理员
首页
用户管理
封禁/解除用户
用户列表
用户行为记录
歌手管理
封禁/解封歌手
歌手歌曲
歌曲内容管理
歌曲收藏
评论管理
歌曲信息
歌单管理
社区管理
帖子审核
帖子发布
举报处理
数据分析
播放量分析
用户分析
管理员管理
系统管理
<template id="homeTpl" class="">
首页
用户数量
新增用户数{{usernum}}
总用户数{{totalusernum}}
歌手数量
总歌手数{{singernum}}
代办事项
无
快捷入口
用户
用户
用户
用户
用户
用户
用户
用户
访问统计
</template>
<template id="usersTpl">
首页->用户
用户名:
<input placeholder="查询内容" class="pt-2 pb-2 rounded" />
查询
新增
删除
选择
索引
用户名
头像
性别
账号
操作
</template>
<template id="singerTpl">
首页->歌手
歌手/歌曲:
<input placeholder="查询内容" class="pt-2 pb-2 rounded" />
查询
新增
删除
<input type="checkbox" id="selectAll" class="checkbox">
索引
歌手
照片
性别
歌曲
操作
加载中...
</template>
<template id="gedanTpl">
首页->歌单
歌单:
<input placeholder="查询内容" class="pt-2 pb-2 rounded" />
查询
新增
删除
索引
歌曲名称
海报
歌曲分类
歌手
视频
操作
加载中...
</template>
<template id="shequTpl">
首页->社区
歌单:
<input placeholder="查询内容" class="pt-2 pb-2 rounded" />
查询
新增
删除
<input type="checkbox" id="selectAll">
编号
帖子标题
发布人
发布时间
更新时间
审核时间
状态
操作
加载中...
</template>
<template id="shujuTpl">
播放量
平台总播放量分析
歌手播放量
当前趋势分析
</template>
<template id="guanliTpl">
管理员管理
管理员
</template>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.js"></script>
<script src="js/cebianlan.js"></script>
</body>
</html>在js中新增20条用户数据,能够进行增删设置,搜索设置






用handlebars将 登录 <button type="button" class="close" data-dismiss="modal" aria-label="Close"> × </button> <form> <label for="username">用户名</label> !用户名需6-8位数字字母 <input type="text" class="form-control " id="username" aria-describedby="emailHelp" placeholder="用户名6-8位数字字母"> <label for="password">密码</label> !密码需8-12位至少包含一位(数字\大小写字母) <input type="password" class="form-control" id="password" placeholder="密码8-12位至少包含一位(数字\大小写字母)"> </form> <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button> <button type="button" class="btn btn-primary">登录</button> 渲染到标签里面,通过 登录 / 注册 按钮来实现






