perf:统一用户信息组件的数据来源
This commit is contained in:
@@ -17,8 +17,12 @@
|
||||
>
|
||||
</div>
|
||||
<div class="status" v-if="userInfo.userLimit">
|
||||
<el-tag round effect="light" :type="userInfo.userLimit.type">
|
||||
{{ userInfo.userLimit.label }}
|
||||
<el-tag
|
||||
round
|
||||
effect="light"
|
||||
:type="getStatusInfo(userInfo.userLimit)?.type"
|
||||
>
|
||||
{{ getStatusInfo(userInfo.userLimit)?.label }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -107,7 +111,7 @@ const Init = () => {
|
||||
userInfo.role = props.userInfo.role;
|
||||
userInfo.id = props.userInfo.id;
|
||||
userInfo.level = props.userInfo.level;
|
||||
userInfo.userLimit = getStatusInfo(props.userInfo.userLimit);
|
||||
userInfo.userLimit = props.userInfo.userLimit;
|
||||
iconUrl.value = iconUrlHandler(userInfo.icon);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="score">积分:3005</div>
|
||||
<div class="status">
|
||||
<span>状态:</span>
|
||||
<span> {{ getStatusInfo(userInfo.userLimit.label) }}</span>
|
||||
<span> {{ getStatusInfo(userInfo.userLimit) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hobby">
|
||||
@@ -98,7 +98,7 @@ const statusTypeList = [
|
||||
},
|
||||
];
|
||||
const getStatusInfo = (type) => {
|
||||
return statusTypeList.filter((item) => item.value === type)[0];
|
||||
return statusTypeList.filter((item) => item.value === type)[0]?.label;
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user