feat: 新增sidermenu首页项
This commit is contained in:
@@ -10,7 +10,17 @@ 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 +31,7 @@ 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 = [...menuList.value, ...generateMenu(mData)]
|
||||
addAsyncRouters(asyncRouters.value)
|
||||
isLoadRoutes.value = false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user