yuang-framework-ui-pc 1.1.131 → 1.1.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ele-menus/index.d.ts +3 -3
- package/es/ele-menus/index.js +31 -5
- package/lib/ele-menus/index.cjs +31 -5
- package/lib/ele-menus/index.d.ts +3 -3
- package/package.json +1 -1
package/es/ele-menus/index.d.ts
CHANGED
|
@@ -316,7 +316,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
316
316
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
317
317
|
readonly popperOffset: NumberConstructor;
|
|
318
318
|
readonly expandCloseIcon: {
|
|
319
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
319
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
320
320
|
readonly required: false;
|
|
321
321
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
322
322
|
__epPropKey: true;
|
|
@@ -397,7 +397,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
397
397
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
398
398
|
readonly popperOffset: NumberConstructor;
|
|
399
399
|
readonly expandCloseIcon: {
|
|
400
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
400
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
401
401
|
readonly required: false;
|
|
402
402
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
403
403
|
__epPropKey: true;
|
|
@@ -2080,7 +2080,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2080
2080
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
2081
2081
|
readonly popperOffset: NumberConstructor;
|
|
2082
2082
|
readonly expandCloseIcon: {
|
|
2083
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
2083
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
2084
2084
|
readonly required: false;
|
|
2085
2085
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
2086
2086
|
__epPropKey: true;
|
package/es/ele-menus/index.js
CHANGED
|
@@ -62,20 +62,46 @@ const _sfc_main = defineComponent({
|
|
|
62
62
|
}
|
|
63
63
|
hideTooltip();
|
|
64
64
|
};
|
|
65
|
+
const isPageFirstLoad = ref(true);
|
|
66
|
+
const isNavigating = ref(false);
|
|
67
|
+
onMounted(() => {
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
isPageFirstLoad.value = false;
|
|
70
|
+
}, 100);
|
|
71
|
+
});
|
|
65
72
|
const handleOpen = (index2, indexPath) => {
|
|
66
73
|
var _a2;
|
|
67
74
|
emit("open", index2, indexPath);
|
|
75
|
+
const currentPath = window.location.pathname;
|
|
76
|
+
if (isPageFirstLoad.value) return;
|
|
77
|
+
if (isNavigating.value) return;
|
|
68
78
|
function findFirstLeaf(menu) {
|
|
69
79
|
if (!menu.children || !menu.children.length) return menu;
|
|
70
80
|
return findFirstLeaf(menu.children[0]);
|
|
71
81
|
}
|
|
72
82
|
const currentItem = (_a2 = menuItems.value) == null ? void 0 : _a2.find((m) => m.index === index2);
|
|
73
|
-
if (currentItem == null ? void 0 : currentItem.children)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
if (!(currentItem == null ? void 0 : currentItem.children)) return;
|
|
84
|
+
const firstLeaf = findFirstLeaf(currentItem);
|
|
85
|
+
if (!(firstLeaf == null ? void 0 : firstLeaf.path)) return;
|
|
86
|
+
const isInThisMenu = checkPathInMenuTree(currentItem, currentPath);
|
|
87
|
+
if (!isInThisMenu) {
|
|
88
|
+
isNavigating.value = true;
|
|
89
|
+
router.push(firstLeaf.path).finally(() => {
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
isNavigating.value = false;
|
|
92
|
+
}, 100);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const checkPathInMenuTree = (menu, path) => {
|
|
97
|
+
var _a2;
|
|
98
|
+
if (menu.path === path) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
if ((_a2 = menu.children) == null ? void 0 : _a2.length) {
|
|
102
|
+
return menu.children.some((child) => checkPathInMenuTree(child, path));
|
|
78
103
|
}
|
|
104
|
+
return false;
|
|
79
105
|
};
|
|
80
106
|
const handleClose = (index2, indexPath) => {
|
|
81
107
|
emit("close", index2, indexPath);
|
package/lib/ele-menus/index.cjs
CHANGED
|
@@ -63,20 +63,46 @@ const _sfc_main = vue.defineComponent({
|
|
|
63
63
|
}
|
|
64
64
|
hideTooltip();
|
|
65
65
|
};
|
|
66
|
+
const isPageFirstLoad = vue.ref(true);
|
|
67
|
+
const isNavigating = vue.ref(false);
|
|
68
|
+
vue.onMounted(() => {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
isPageFirstLoad.value = false;
|
|
71
|
+
}, 100);
|
|
72
|
+
});
|
|
66
73
|
const handleOpen = (index2, indexPath) => {
|
|
67
74
|
var _a2;
|
|
68
75
|
emit("open", index2, indexPath);
|
|
76
|
+
const currentPath = window.location.pathname;
|
|
77
|
+
if (isPageFirstLoad.value) return;
|
|
78
|
+
if (isNavigating.value) return;
|
|
69
79
|
function findFirstLeaf(menu) {
|
|
70
80
|
if (!menu.children || !menu.children.length) return menu;
|
|
71
81
|
return findFirstLeaf(menu.children[0]);
|
|
72
82
|
}
|
|
73
83
|
const currentItem = (_a2 = menuItems.value) == null ? void 0 : _a2.find((m) => m.index === index2);
|
|
74
|
-
if (currentItem == null ? void 0 : currentItem.children)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
if (!(currentItem == null ? void 0 : currentItem.children)) return;
|
|
85
|
+
const firstLeaf = findFirstLeaf(currentItem);
|
|
86
|
+
if (!(firstLeaf == null ? void 0 : firstLeaf.path)) return;
|
|
87
|
+
const isInThisMenu = checkPathInMenuTree(currentItem, currentPath);
|
|
88
|
+
if (!isInThisMenu) {
|
|
89
|
+
isNavigating.value = true;
|
|
90
|
+
router.push(firstLeaf.path).finally(() => {
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
isNavigating.value = false;
|
|
93
|
+
}, 100);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const checkPathInMenuTree = (menu, path) => {
|
|
98
|
+
var _a2;
|
|
99
|
+
if (menu.path === path) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
if ((_a2 = menu.children) == null ? void 0 : _a2.length) {
|
|
103
|
+
return menu.children.some((child) => checkPathInMenuTree(child, path));
|
|
79
104
|
}
|
|
105
|
+
return false;
|
|
80
106
|
};
|
|
81
107
|
const handleClose = (index2, indexPath) => {
|
|
82
108
|
emit("close", index2, indexPath);
|
package/lib/ele-menus/index.d.ts
CHANGED
|
@@ -316,7 +316,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
316
316
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
317
317
|
readonly popperOffset: NumberConstructor;
|
|
318
318
|
readonly expandCloseIcon: {
|
|
319
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
319
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
320
320
|
readonly required: false;
|
|
321
321
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
322
322
|
__epPropKey: true;
|
|
@@ -397,7 +397,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
397
397
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
398
398
|
readonly popperOffset: NumberConstructor;
|
|
399
399
|
readonly expandCloseIcon: {
|
|
400
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
400
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
401
401
|
readonly required: false;
|
|
402
402
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
403
403
|
__epPropKey: true;
|
|
@@ -2080,7 +2080,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2080
2080
|
readonly teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
2081
2081
|
readonly popperOffset: NumberConstructor;
|
|
2082
2082
|
readonly expandCloseIcon: {
|
|
2083
|
-
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
2083
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) | ((new (... /** 父菜单关闭事件 */args: any[]) => (string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>) & {}) | (() => string | import('vue').Component<any, any, any, import('vue').ComputedOptions, import('vue').MethodOptions>))[], unknown, unknown>>;
|
|
2084
2084
|
readonly required: false;
|
|
2085
2085
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
2086
2086
|
__epPropKey: true;
|