style: 代码格式优化
This commit is contained in:
1 parent
a422f9f962
commit
55086c6757
35 files changed
+4045
-3515
No files matched your search
+35
-32
@@ -4,7 +4,12 @@
|
||||
<template v-for="(item, index) in visibleGridList" :key="index">
|
||||
<wd-card :title="item.title">
|
||||
<wd-grid clickable :column="4">
|
||||
<wd-grid-item v-for="(child, childIndex) in item.children" :key="childIndex" use-slot @click="handleNavClick(child)">
|
||||
<wd-grid-item
|
||||
v-for="(child, childIndex) in item.children"
|
||||
:key="childIndex"
|
||||
use-slot
|
||||
@click="handleNavClick(child)"
|
||||
>
|
||||
<view class="work-grid__icon p-2">
|
||||
<image class="w-72rpx h-72rpx rounded-8rpx" :src="child.icon" />
|
||||
</view>
|
||||
@@ -17,39 +22,37 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import { useNavbar } from "@/composables/useNavbar";
|
||||
import { useNavigation } from "@/composables/useNavigation";
|
||||
import { menuConfig } from "@/config/menu";
|
||||
import { hasPermission as checkPermission } from "@/utils/permission";
|
||||
|
||||
import { computed } from "vue";
|
||||
import { useNavbar } from "@/composables/useNavbar";
|
||||
import { useNavigation } from "@/composables/useNavigation";
|
||||
import { menuConfig } from "@/config/menu";
|
||||
import { hasPermission as checkPermission } from "@/utils/permission";
|
||||
definePage({
|
||||
name: "work",
|
||||
style: {
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "工作台",
|
||||
},
|
||||
layout: "tabbar",
|
||||
});
|
||||
|
||||
definePage({
|
||||
name: "work",
|
||||
style: {
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: "工作台",
|
||||
},
|
||||
layout: "tabbar",
|
||||
});
|
||||
const navbar = useNavbar();
|
||||
const { handleNavClick } = useNavigation();
|
||||
|
||||
const navbar = useNavbar();
|
||||
const { handleNavClick } = useNavigation();
|
||||
// 检查是否有权限
|
||||
const hasPermission = (perm: string) => {
|
||||
if (!perm) return true;
|
||||
return checkPermission(perm);
|
||||
};
|
||||
|
||||
// 检查是否有权限
|
||||
const hasPermission = (perm: string) => {
|
||||
if (!perm) return true;
|
||||
return checkPermission(perm);
|
||||
};
|
||||
|
||||
// 根据权限过滤后的菜单列表
|
||||
const visibleGridList = computed(() => {
|
||||
return menuConfig
|
||||
.map((group) => ({
|
||||
...group,
|
||||
children: group.children.filter((item) => hasPermission(item.perm)),
|
||||
}))
|
||||
.filter((group) => group.children.length > 0);
|
||||
});
|
||||
// 根据权限过滤后的菜单列表
|
||||
const visibleGridList = computed(() => {
|
||||
return menuConfig
|
||||
.map((group) => ({
|
||||
...group,
|
||||
children: group.children.filter((item) => hasPermission(item.perm)),
|
||||
}))
|
||||
.filter((group) => group.children.length > 0);
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user