mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
fix: showLink is false,children menu 404
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { store } from "/@/store";
|
||||
|
||||
import { constantRoutesArr, ascending } from "/@/router/index";
|
||||
import { constantRoutesArr, ascending, filterTree } from "/@/router/index";
|
||||
|
||||
export const usePermissionStore = defineStore({
|
||||
id: "pure-permission",
|
||||
@@ -13,14 +12,6 @@ export const usePermissionStore = defineStore({
|
||||
}),
|
||||
actions: {
|
||||
asyncActionRoutes(routes) {
|
||||
const filterTree = data => {
|
||||
const newTree = data.filter(v => v.meta.showLink);
|
||||
newTree.forEach(
|
||||
v => v.children && (v.children = filterTree(v.children))
|
||||
);
|
||||
return newTree;
|
||||
};
|
||||
|
||||
if (this.wholeRoutes.length > 0) return;
|
||||
this.wholeRoutes = filterTree(
|
||||
ascending(this.constantRoutes.concat(routes))
|
||||
|
||||
Reference in New Issue
Block a user