mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-15 14:03:36 +08:00
chore: update
This commit is contained in:
@@ -167,6 +167,7 @@ let autoPlay = computed(() => {
|
||||
|
||||
let scrollSwitch = computed(() => {
|
||||
// 从 props 解构出来的 属性 不再具有相应性.
|
||||
// @ts-expect-error
|
||||
return props.data.length >= unref(options).limitMoveNum;
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { emitter } from "/@/utils/mitt";
|
||||
|
||||
let show = ref<Boolean>(false);
|
||||
const target = ref(null);
|
||||
onClickOutside(target, event => {
|
||||
onClickOutside(target, (event: any) => {
|
||||
if (event.clientX > target.value.offsetLeft) return;
|
||||
show.value = false;
|
||||
});
|
||||
|
||||
@@ -9,8 +9,8 @@ import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
|
||||
const route = useRoute();
|
||||
const levelList = ref([]);
|
||||
const router = useRouter();
|
||||
const routes = router.options.routes;
|
||||
const multiTags = useMultiTagsStoreHook().multiTags;
|
||||
const routes: any = router.options.routes;
|
||||
const multiTags: any = useMultiTagsStoreHook().multiTags;
|
||||
|
||||
const isDashboard = (route: RouteLocationMatched): boolean | string => {
|
||||
const name = route && (route.name as string);
|
||||
|
||||
@@ -289,6 +289,7 @@ function dynamicRouteTag(value: string, parentPath: string): void {
|
||||
});
|
||||
}
|
||||
}
|
||||
// @ts-expect-error
|
||||
concatPath(router.options.routes, value, parentPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer";
|
||||
|
||||
const modules = import.meta.globEager("../mock/*.ts");
|
||||
const modules: Record<string, any> = import.meta.glob("../mock/*.ts", {
|
||||
eager: true
|
||||
});
|
||||
const mockModules = [];
|
||||
|
||||
Object.keys(modules).forEach(key => {
|
||||
|
||||
@@ -10,12 +10,12 @@ import zhLocale from "element-plus/lib/locale/lang/zh-cn";
|
||||
|
||||
function siphonI18n(prefix = "zh-CN") {
|
||||
return Object.fromEntries(
|
||||
Object.entries(import.meta.globEager("../../locales/*.y(a)?ml")).map(
|
||||
([key, value]) => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)[1];
|
||||
return [matched, value.default];
|
||||
}
|
||||
)
|
||||
Object.entries(
|
||||
import.meta.glob("../../locales/*.y(a)?ml", { eager: true })
|
||||
).map(([key, value]: any) => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)[1];
|
||||
return [matched, value.default];
|
||||
})
|
||||
)[prefix];
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ export const remainingPaths = Object.keys(remainingRouter).map(v => {
|
||||
// 创建路由实例
|
||||
export const router: Router = createRouter({
|
||||
history: getHistoryMode(),
|
||||
// @ts-expect-error
|
||||
routes: constantRoutes.concat(...remainingRouter),
|
||||
strict: true,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
@@ -150,7 +151,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
|
||||
};
|
||||
// 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对静态路由)
|
||||
if (to.meta?.refreshRedirect) {
|
||||
const routes = router.options.routes;
|
||||
const routes: any = router.options.routes;
|
||||
const { refreshRedirect } = to.meta;
|
||||
const { name, meta } = findRouteByPath(refreshRedirect, routes);
|
||||
handTag(
|
||||
@@ -165,7 +166,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
|
||||
const index = findIndex(remainingRouter, v => {
|
||||
return v.path == path;
|
||||
});
|
||||
const routes =
|
||||
const routes: any =
|
||||
index === -1
|
||||
? router.options.routes[0].children
|
||||
: router.options.routes;
|
||||
|
||||
@@ -172,9 +172,9 @@ function onEdit(row?: onEditNRow) {
|
||||
}
|
||||
|
||||
// 拷贝当前列表项的数据(字典类型)
|
||||
const { clipboardRef } = useCopyToClipboard();
|
||||
const { clipboardValue } = useCopyToClipboard();
|
||||
const cellDBLClickEvent: VxeTableEvents.CellDblclick = ({ row }) => {
|
||||
clipboardRef.value = unref(row).model;
|
||||
clipboardValue.value = unref(row).model;
|
||||
};
|
||||
|
||||
const xTable = ref({} as VxeTableInstance);
|
||||
|
||||
@@ -38,9 +38,8 @@ function onCloseTags() {
|
||||
getNodeByUniqueId(treeData.value, uniqueId).path;
|
||||
useMultiTagsStoreHook().handleTags("splice", currentPath);
|
||||
if (currentPath === "/tabs/index")
|
||||
router.push({
|
||||
path: multiTags.value[multiTags.value.length - 1].path
|
||||
});
|
||||
// @ts-expect-error
|
||||
router.push({ path: multiTags.value[multiTags.value.length - 1].path });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -12,6 +12,7 @@ setOptions(
|
||||
},
|
||||
legend: {
|
||||
orient: "vertical",
|
||||
// @ts-expect-error
|
||||
right: true
|
||||
},
|
||||
series: [
|
||||
|
||||
Reference in New Issue
Block a user