Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/vue": "^4.1.2",
|
||||
"lucide-vue-next": "^0.426.0",
|
||||
"lucide-vue-next": "^0.427.0",
|
||||
"vue": "^3.4.37"
|
||||
}
|
||||
}
|
||||
|
@@ -9,4 +9,4 @@ export * from './tree';
|
||||
export * from './unique';
|
||||
export * from './update-css-variables';
|
||||
export * from './window';
|
||||
export { default as cloneDepp } from 'lodash.clonedeep';
|
||||
export { default as cloneDeep } from 'lodash.clonedeep';
|
||||
|
@@ -48,7 +48,7 @@
|
||||
"@vben-core/typings": "workspace:*",
|
||||
"@vueuse/core": "^10.11.1",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"lucide-vue-next": "^0.426.0",
|
||||
"lucide-vue-next": "^0.427.0",
|
||||
"radix-vue": "^1.9.3",
|
||||
"vue": "^3.4.37"
|
||||
}
|
||||
|
@@ -33,7 +33,8 @@ function handleClick(path?: string) {
|
||||
<a href="javascript:void 0" @click.stop="handleClick(item.path)">
|
||||
<span class="flex-center z-10 h-full">
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
v-if="showIcon"
|
||||
:fallback="showIcon"
|
||||
:icon="item.icon"
|
||||
class="mr-1 size-4 flex-shrink-0"
|
||||
/>
|
||||
|
@@ -51,7 +51,8 @@ function handleClick(path?: string) {
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger class="flex items-center gap-1">
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
v-if="showIcon"
|
||||
:fallback="showIcon"
|
||||
:icon="item.icon"
|
||||
class="size-5"
|
||||
/>
|
||||
@@ -77,8 +78,9 @@ function handleClick(path?: string) {
|
||||
>
|
||||
<div class="flex-center">
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
v-if="showIcon"
|
||||
:class="{ 'size-5': item.isHome }"
|
||||
:fallback="showIcon"
|
||||
:icon="item.icon"
|
||||
class="mr-1 size-4"
|
||||
/>
|
||||
@@ -88,8 +90,9 @@ function handleClick(path?: string) {
|
||||
<BreadcrumbPage v-else>
|
||||
<div class="flex-center">
|
||||
<VbenIcon
|
||||
v-if="item.icon && showIcon"
|
||||
v-if="showIcon"
|
||||
:class="{ 'size-5': item.isHome }"
|
||||
:fallback="showIcon"
|
||||
:icon="item.icon"
|
||||
class="mr-1 size-4"
|
||||
/>
|
||||
|
@@ -5,7 +5,7 @@ import type {
|
||||
} from '@vben/types';
|
||||
|
||||
import {
|
||||
cloneDepp,
|
||||
cloneDeep,
|
||||
generateMenus,
|
||||
generateRoutesByBackend,
|
||||
generateRoutesByFrontend,
|
||||
@@ -18,7 +18,7 @@ async function generateAccessible(
|
||||
) {
|
||||
const { router } = options;
|
||||
|
||||
options.routes = cloneDepp(options.routes);
|
||||
options.routes = cloneDeep(options.routes);
|
||||
// 生成路由
|
||||
const accessibleRoutes = await generateRoutes(mode, options);
|
||||
|
||||
|
@@ -56,7 +56,9 @@ export function useAntdDesignTokens() {
|
||||
|
||||
tokens.colorBgBase = getCssVariableValue('--background');
|
||||
|
||||
tokens.borderRadius = getCssVariableValue('--radius', false);
|
||||
const radius = Number.parseFloat(getCssVariableValue('--radius', false));
|
||||
// 1rem = 16px
|
||||
tokens.borderRadius = radius * 16;
|
||||
|
||||
tokens.colorBgLayout = getCssVariableValue('--background-deep');
|
||||
tokens.colorBgMask = getCssVariableValue('--overlay');
|
||||
|
@@ -1,9 +1,6 @@
|
||||
import type { TabDefinition } from '@vben/types';
|
||||
import type { IContextMenuItem } from '@vben-core/tabs-ui';
|
||||
import type {
|
||||
RouteLocationNormalized,
|
||||
RouteLocationNormalizedGeneric,
|
||||
} from 'vue-router';
|
||||
import type { RouteLocationNormalizedGeneric } from 'vue-router';
|
||||
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
@@ -103,7 +100,14 @@ export function useTabbar() {
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
tabbarStore.addTab(route as RouteLocationNormalized);
|
||||
// 这里不能用route,用route时,vue-router会自动将父级meta进行合并
|
||||
const routes = router.getRoutes();
|
||||
const currentRoute = routes.find((item) => item.path === route.path);
|
||||
if (currentRoute) {
|
||||
tabbarStore.addTab(
|
||||
currentRoute as unknown as RouteLocationNormalizedGeneric,
|
||||
);
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
Reference in New Issue
Block a user