优化前端
This commit is contained in:
@@ -35,7 +35,10 @@ function toggleLocale() {
|
||||
}
|
||||
|
||||
function isActive(path) {
|
||||
return route.path === path;
|
||||
if (path === '/') {
|
||||
return route.path === '/'
|
||||
}
|
||||
return route.path.startsWith(path)
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
@@ -51,7 +54,7 @@ const navItems = computed(() => [
|
||||
{ label: t("appname.schedule"), to: "/schedule" },
|
||||
{ label: t("appname.purchase"), to: "/purchase" },
|
||||
{ label: t("appname.work_order"), to: "/work_order" },
|
||||
{ label: t("appname.warehouse"), to: "/warehouse/container" },
|
||||
{ label: t("appname.warehouse"), to: "/warehouse" },
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ const router = createRouter({
|
||||
name: 'work-order-show',
|
||||
component: () => import('@/views/work_order/ShowWorkOrder.vue'),
|
||||
},
|
||||
{
|
||||
path: 'warehouse',
|
||||
redirect: '/warehouse/container',
|
||||
},
|
||||
{
|
||||
path: 'warehouse/container',
|
||||
name: 'warehouse',
|
||||
|
||||
Reference in New Issue
Block a user