@pubinfo/core 2.1.10 → 2.1.11
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/dist/built-in/layout-component/composables/useContext.d.ts +1 -0
- package/dist/index.js +43 -26
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/src/built-in/layout-component/components/Menu/item.vue +2 -2
- package/src/built-in/layout-component/components/Menu/sub.vue +20 -1
- package/src/built-in/layout-component/composables/useContext.ts +1 -0
- package/src/built-in/layout-component/provider.ts +5 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.11",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"pinia": "^3.0.4",
|
|
32
32
|
"vue": "^3.5.28",
|
|
33
33
|
"vue-router": "^5.0.2",
|
|
34
|
-
"@pubinfo/config": "2.1.
|
|
35
|
-
"@pubinfo/devtools": "2.1.
|
|
36
|
-
"@pubinfo/vite": "2.1.
|
|
34
|
+
"@pubinfo/config": "2.1.11",
|
|
35
|
+
"@pubinfo/devtools": "2.1.11",
|
|
36
|
+
"@pubinfo/vite": "2.1.11"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@alova/adapter-axios": "^2.0.17",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"unctx": "^2.5.0",
|
|
64
64
|
"vue-m-message": "^4.0.2",
|
|
65
65
|
"zxcvbn": "^4.4.2",
|
|
66
|
-
"@pubinfo/shared": "2.1.
|
|
66
|
+
"@pubinfo/shared": "2.1.11"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@alova/mock": "^2.0.18",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"vite-plugin-dts": "^4.5.4",
|
|
94
94
|
"vue": "^3.5.28",
|
|
95
95
|
"vue-router": "^5.0.2",
|
|
96
|
-
"@pubinfo/config": "2.1.
|
|
97
|
-
"@pubinfo/vite": "2.1.
|
|
96
|
+
"@pubinfo/config": "2.1.11",
|
|
97
|
+
"@pubinfo/vite": "2.1.11"
|
|
98
98
|
},
|
|
99
99
|
"scripts": {
|
|
100
100
|
"dev": "vite build -w -m watch",
|
|
@@ -18,7 +18,7 @@ const props = withDefaults(
|
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
const rootMenu = inject(rootMenuInjectionKey)!;
|
|
21
|
-
const { generateTitle } = useContext();
|
|
21
|
+
const { generateTitle, indentSize } = useContext();
|
|
22
22
|
|
|
23
23
|
const itemRef = ref<HTMLElement>();
|
|
24
24
|
|
|
@@ -70,7 +70,7 @@ const safeIconColor = computed<string | undefined>(() => iconOptions.value?.icon
|
|
|
70
70
|
// 缩进样式
|
|
71
71
|
const indentStyle = computed(() => {
|
|
72
72
|
return !rootMenu.isMenuPopup
|
|
73
|
-
? `padding-left: ${
|
|
73
|
+
? `padding-left: ${indentSize * (props.level ?? 0)}px`
|
|
74
74
|
: '';
|
|
75
75
|
});
|
|
76
76
|
|
|
@@ -193,8 +193,9 @@ function handleMouseleave() {
|
|
|
193
193
|
/>
|
|
194
194
|
<Teleport v-if="hasChildren" to="body" :disabled="!rootMenu.isMenuPopup">
|
|
195
195
|
<Transition v-bind="transitionClass" v-on="transitionEvent">
|
|
196
|
+
<!-- Popup submenu: use OverlayScrollbars so it can scroll independently -->
|
|
196
197
|
<OverlayScrollbarsComponent
|
|
197
|
-
v-if="opened"
|
|
198
|
+
v-if="opened && rootMenu.isMenuPopup"
|
|
198
199
|
ref="subMenuRef"
|
|
199
200
|
:options="{ scrollbars: { visibility: 'hidden' } }"
|
|
200
201
|
defer
|
|
@@ -215,6 +216,24 @@ function handleMouseleave() {
|
|
|
215
216
|
/>
|
|
216
217
|
</template>
|
|
217
218
|
</OverlayScrollbarsComponent>
|
|
219
|
+
|
|
220
|
+
<!-- Inline submenu (non-popup): render as plain container to allow parent scroll -->
|
|
221
|
+
<div
|
|
222
|
+
v-else-if="opened"
|
|
223
|
+
class="sub-menu"
|
|
224
|
+
:class="{
|
|
225
|
+
'rounded-2 py-1': rootMenu.props.rounded && !rootMenu.isMenuPopup,
|
|
226
|
+
}"
|
|
227
|
+
>
|
|
228
|
+
<template v-for="item in menu.children" :key="item.path ?? JSON.stringify(item)">
|
|
229
|
+
<SubMenu
|
|
230
|
+
v-if="item.meta?.sidebar !== false"
|
|
231
|
+
:unique-key="[...uniqueKey, item.path ?? JSON.stringify(item)]"
|
|
232
|
+
:menu="item"
|
|
233
|
+
:level="level + 1"
|
|
234
|
+
/>
|
|
235
|
+
</template>
|
|
236
|
+
</div>
|
|
218
237
|
</Transition>
|
|
219
238
|
</Teleport>
|
|
220
239
|
</template>
|
|
@@ -24,6 +24,10 @@ export const Provider = defineComponent({
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: false,
|
|
26
26
|
},
|
|
27
|
+
indentSize: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 32,
|
|
30
|
+
},
|
|
27
31
|
},
|
|
28
32
|
setup(props, { slots }) {
|
|
29
33
|
const settingsStore = useSettingsStore();
|
|
@@ -49,6 +53,7 @@ export const Provider = defineComponent({
|
|
|
49
53
|
|
|
50
54
|
appTitle: props.appTitle,
|
|
51
55
|
isDev: props.isDev,
|
|
56
|
+
indentSize: props.indentSize,
|
|
52
57
|
generateTitle,
|
|
53
58
|
});
|
|
54
59
|
|