修复菜单组件重复添加首页问题
This commit is contained in:
@ -49,7 +49,9 @@
|
||||
const { data: tdkList } = await useAsyncData('get-tdk-list-home', async () => {
|
||||
const res = await getTDKList()
|
||||
// 添加首页
|
||||
res.data.unshift({ remark: '首页', path: '/' })
|
||||
if (!res.data.find((c) => c.remark === '首页')) {
|
||||
res.data.unshift({ remark: '首页', path: '/' })
|
||||
}
|
||||
return res.data
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user