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