diff --git a/src/components/Dict/index.vue b/src/components/Dict/index.vue index 1a6b931c..743ae2b9 100644 --- a/src/components/Dict/index.vue +++ b/src/components/Dict/index.vue @@ -124,7 +124,8 @@ watch( (option) => option.value === selectedValue.value ); if (!matchedOption && props.type !== "checkbox") { - selectedValue.value = ""; // 如果找不到匹配项,清空选中 + // 如果找不到匹配项,清空选中 + selectedValue.value = ""; } } } diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 77940aed..de3a0c3f 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -1,19 +1,18 @@ import type { RouteRecordRaw } from "vue-router"; import { constantRoutes } from "@/router"; import { store } from "@/store"; -import MenuAPI, { type RouteVO } from "@/api/system/menu"; +import router from "@/router"; +import MenuAPI, { type RouteVO } from "@/api/system/menu"; const modules = import.meta.glob("../../views/**/**.vue"); const Layout = () => import("@/layout/index.vue"); -import router from "@/router"; - export const usePermissionStore = defineStore("permission", () => { - /** 所有路由,包括静态和动态路由 */ + // 所有路由,包括静态和动态路由 const routes = ref([]); - /** 混合模式左侧菜单 */ + // 混合模式左侧菜单 const mixLeftMenus = ref([]); - + // 路由是否已加载 const isRoutesLoaded = ref(false); /** @@ -53,7 +52,8 @@ export const usePermissionStore = defineStore("permission", () => { // 删除动态路由,保留静态路由 routes.value.forEach((route) => { if (route.name && !constantRoutes.find((r) => r.name === route.name)) { - router.removeRoute(route.name); // 从 router 实例中移除动态路由 + // 从 router 实例中移除动态路由 + router.removeRoute(route.name); } }); @@ -103,8 +103,7 @@ const transformRoutes = (routes: RouteVO[]) => { }; /** - * 在组件外使用 Pinia store 实例 - * @see https://pinia.vuejs.org/core-concepts/outside-component-usage.html + * 在组件外使用 Pinia store 实例 @see https://pinia.vuejs.org/core-concepts/outside-component-usage.html */ export function usePermissionStoreHook() { return usePermissionStore(store); diff --git a/src/views/system/user/components/DeptTree.vue b/src/views/system/user/components/DeptTree.vue index 56633afe..9558f36e 100644 --- a/src/views/system/user/components/DeptTree.vue +++ b/src/views/system/user/components/DeptTree.vue @@ -46,7 +46,9 @@ watchEffect( } ); -/** 部门筛选 */ +/** + * 部门筛选 + */ function handleFilter(value: string, data: any) { if (!value) { return true;