diff --git a/apps/core-ant-design-vue/src/store/modules/app/menu.ts b/apps/core-ant-design-vue/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-ant-design-vue/src/store/modules/app/menu.ts +++ b/apps/core-ant-design-vue/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-antdv-next/src/store/modules/app/menu.ts b/apps/core-antdv-next/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-antdv-next/src/store/modules/app/menu.ts +++ b/apps/core-antdv-next/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-arco-design-vue/src/store/modules/app/menu.ts b/apps/core-arco-design-vue/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-arco-design-vue/src/store/modules/app/menu.ts +++ b/apps/core-arco-design-vue/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-element-plus/src/store/modules/app/menu.ts b/apps/core-element-plus/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-element-plus/src/store/modules/app/menu.ts +++ b/apps/core-element-plus/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-naive-ui/src/store/modules/app/menu.ts b/apps/core-naive-ui/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-naive-ui/src/store/modules/app/menu.ts +++ b/apps/core-naive-ui/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-tdesign/src/store/modules/app/menu.ts b/apps/core-tdesign/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-tdesign/src/store/modules/app/menu.ts +++ b/apps/core-tdesign/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core-vexip-ui/src/store/modules/app/menu.ts b/apps/core-vexip-ui/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core-vexip-ui/src/store/modules/app/menu.ts +++ b/apps/core-vexip-ui/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/core/src/store/modules/app/menu.ts b/apps/core/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/core/src/store/modules/app/menu.ts +++ b/apps/core/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/example/src/store/modules/app/menu.ts b/apps/example/src/store/modules/app/menu.ts index 1dd9e34d..fe64eac0 100755 --- a/apps/example/src/store/modules/app/menu.ts +++ b/apps/example/src/store/modules/app/menu.ts @@ -180,7 +180,7 @@ export const useAppMenuStore = defineStore( if (item.children) { return isPathInMenus(item.children, path) } - return path.indexOf(`${item.path}/`) === 0 || path === item.path + return path.startsWith(`${item.path}/`) || path === item.path }) return flag } diff --git a/apps/example/src/views/ui_example/index.vue b/apps/example/src/views/ui_example/index.vue index 2b7a45eb..40c22e21 100755 --- a/apps/example/src/views/ui_example/index.vue +++ b/apps/example/src/views/ui_example/index.vue @@ -77,7 +77,7 @@ function openGuide() { -
+