通过isSysAdmin配合计算属性的computed过滤渲染项
This commit is contained in:
parent
eece503e06
commit
3f4296859f
|
|
@ -19,19 +19,19 @@
|
|||
|
||||
<!-- 功能菜单区域 -->
|
||||
<view class="menu-section">
|
||||
<view v-for="(item, index) in menuItems" :key="index" class="menu-item">
|
||||
<template
|
||||
v-if="item.title !== '牌位录入' || SysAdmin === true"
|
||||
@click="handleMenuClick(item)"
|
||||
>
|
||||
<view class="menu-icon">
|
||||
<image :src="item.icon" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="menu-text">{{ item.title }}</text>
|
||||
<view class="menu-arrow">
|
||||
<image :src="CommonEnum.RIGHT_CHEVRON" mode="aspectFit" />
|
||||
</view>
|
||||
</template>
|
||||
<view
|
||||
v-for="(item, index) in filteredMenuItems"
|
||||
:key="index"
|
||||
class="menu-item"
|
||||
@click="handleMenuClick(item)"
|
||||
>
|
||||
<view class="menu-icon">
|
||||
<image :src="item.icon" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="menu-text">{{ item.title }}</text>
|
||||
<view class="menu-arrow">
|
||||
<image :src="CommonEnum.RIGHT_CHEVRON" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -148,6 +148,11 @@ export default {
|
|||
console.log("<this.userInfo.isReal>:", this.userInfo.isReal);
|
||||
return this.userInfo.isReal.toString() === "true" ? "已实名" : "未实名";
|
||||
},
|
||||
filteredMenuItems() {
|
||||
return this.SysAdmin
|
||||
? this.menuItems
|
||||
: this.menuItems.filter((item) => item.title !== "牌位录入");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user