perf:优化用户限制显示

This commit is contained in:
Xwen
2023-12-23 18:47:28 +08:00
parent e98f24279a
commit 2ba9272043

View File

@@ -11,11 +11,11 @@
<div class="nick" :class="{ mt_1: props.time != 'undefined' }"> <div class="nick" :class="{ mt_1: props.time != 'undefined' }">
<div class="text">{{ userInfo.nick }}</div> <div class="text">{{ userInfo.nick }}</div>
<div class="level"> <div class="level">
<el-tag round effect="light" type="success">{{ <el-tag round effect="light" type="success" v-if="userInfo.level">{{
userInfo.level userInfo.level
}}</el-tag> }}</el-tag>
</div> </div>
<div class="status"> <div class="status" v-if="userInfo.userLimit">
<el-tag round effect="light" :type="userInfo.userLimit.type"> <el-tag round effect="light" :type="userInfo.userLimit.type">
{{ userInfo.userLimit.label }} {{ userInfo.userLimit.label }}
</el-tag> </el-tag>
@@ -58,8 +58,8 @@ const userInfo = reactive({
nick: "", nick: "",
role: [], role: [],
id: "", id: "",
level: 1, level: "",
userLimit: 0, userLimit: "",
}); });
const iconUrl = ref("/favicon.ico"); const iconUrl = ref("/favicon.ico");
const iconUrlHandler = () => { const iconUrlHandler = () => {
@@ -99,7 +99,7 @@ const Init = () => {
userInfo.role = props.userInfo.role; userInfo.role = props.userInfo.role;
userInfo.id = props.userInfo.id; userInfo.id = props.userInfo.id;
userInfo.level = "等级" + props.userInfo.level; userInfo.level = "等级" + props.userInfo.level;
userInfo.userLimit = getStatusInfo(1); userInfo.userLimit = getStatusInfo(props.userInfo.userLimit);
iconUrl.value = iconUrlHandler(userInfo.icon); iconUrl.value = iconUrlHandler(userInfo.icon);
} }