fix : 简化代码模板
This commit is contained in:
@@ -10,7 +10,15 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
const asyncRouters = ref([])
|
||||
//定义是否加载路由变量
|
||||
const isLoadRoutes = ref(false)
|
||||
const menuList = ref([])
|
||||
const menuList = ref([{
|
||||
name: 'home',
|
||||
path: '/home',
|
||||
icon: 'home',
|
||||
title: '工作台',
|
||||
meta: {
|
||||
breadcrumb: true
|
||||
}
|
||||
}])
|
||||
|
||||
const setIsLoadRoutes = (status) => {
|
||||
return isLoadRoutes.value = status
|
||||
@@ -21,7 +29,8 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
const sRouter = JSON.parse(JSON.stringify(res.data))
|
||||
const mData = JSON.parse(JSON.stringify(res.data))
|
||||
asyncRouters.value = formatAsyncRouters(sRouter)
|
||||
menuList.value = generateMenu(mData)
|
||||
// menuList.value = generateMenu(mData)
|
||||
menuList.value = [...menuList.value, ...generateMenu(mData)]
|
||||
addAsyncRouters(asyncRouters.value)
|
||||
isLoadRoutes.value = false
|
||||
} else {
|
||||
@@ -110,4 +119,4 @@ export const usePermisstionStroe = defineStore('permisstion', () => {
|
||||
setIsLoadRoutes,
|
||||
removeMenu
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user