mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-06 03:57:54 +08:00
fix(breadcrumb): 修复类型错误
This commit is contained in:
parent
1ad77b4878
commit
75cb85bc8b
@ -47,10 +47,10 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
// TSESLint docs https://typescript-eslint.io/rules/
|
// TSESLint docs https://typescript-eslint.io/rules/
|
||||||
// 'no-var': 'error', // 禁止使用var
|
'no-var': 'error', // 禁止使用var
|
||||||
// 'no-unused-vars': 'off', // 允许声明不使用的值
|
'no-unused-vars': 'off', // 允许声明不使用的值
|
||||||
// 'no-console': 'off', // 允许出现console
|
'no-console': 'off', // 允许出现console
|
||||||
// 'no-debugger': 'off', // 关闭debugger警告
|
'no-debugger': 'off', // 关闭debugger警告
|
||||||
'vue/multi-word-component-names': 0, // 关闭文件名多单词
|
'vue/multi-word-component-names': 0, // 关闭文件名多单词
|
||||||
// 'import/no-unresolved': ['error', { ignore: ['~icons/*'] }],
|
// 'import/no-unresolved': ['error', { ignore: ['~icons/*'] }],
|
||||||
"@typescript-eslint/no-explicit-any": ["off"], // 允许使用any
|
"@typescript-eslint/no-explicit-any": ["off"], // 允许使用any
|
||||||
|
@ -17,7 +17,10 @@ const router = useRouter();
|
|||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
const { routerPush } = useAppRouter();
|
const { routerPush } = useAppRouter();
|
||||||
const routes = computed(() => {
|
const routes = computed(() => {
|
||||||
return routeStore.createBreadcrumbFromRoutes(router.currentRoute.value.name as string, routeStore.userRoutes);
|
return routeStore.createBreadcrumbFromRoutes(
|
||||||
|
(router.currentRoute.value.name as string) || '/',
|
||||||
|
routeStore.userRoutes,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ export const useRouteStore = defineStore('route-store', {
|
|||||||
router.removeRoute('appRoot');
|
router.removeRoute('appRoot');
|
||||||
},
|
},
|
||||||
/* 根据当前路由的name生成面包屑数据 */
|
/* 根据当前路由的name生成面包屑数据 */
|
||||||
createBreadcrumbFromRoutes(routeName = '/', userRoutes: AppRoute.Route[]) {
|
createBreadcrumbFromRoutes(routeName: string, userRoutes: AppRoute.Route[]) {
|
||||||
const path: AppRoute.Route[] = [];
|
const path: AppRoute.Route[] = [];
|
||||||
// 筛选所有包含目标的各级路由组合成一维数组
|
// 筛选所有包含目标的各级路由组合成一维数组
|
||||||
const getPathfromRoutes = (routeName: string, userRoutes: AppRoute.Route[]) => {
|
const getPathfromRoutes = (routeName: string, userRoutes: AppRoute.Route[]) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user