@keyblade/pro-components 1.0.0 → 1.0.2
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/components.d.ts +2 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +16 -12
- package/es/pro-breadcrumb/index.js +1 -0
- package/es/pro-breadcrumb/pro-breadcrumb.vue.js +14 -6
- package/es/pro-breadcrumb/pro-breadcrumb.vue2.js +2 -2
- package/es/pro-breadcrumb/pro-breadcrumb.vue3.js +5 -0
- package/es/pro-keep-alive-router-view/index.d.ts +124 -0
- package/es/pro-keep-alive-router-view/index.js +11 -0
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.d.ts +45 -0
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +57 -0
- package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue2.js +4 -0
- package/es/pro-layout/hooks.d.ts +3 -2
- package/es/pro-layout/hooks.js +38 -8
- package/es/pro-layout/index.d.ts +15 -9
- package/es/pro-layout/index.js +3 -6
- package/es/pro-layout/pro-layout.vue.d.ts +5 -3
- package/es/pro-layout/pro-layout.vue.js +34 -59
- package/es/pro-menu/index.d.ts +1 -13
- package/es/pro-menu/interface.d.ts +5 -9
- package/es/pro-menu/pro-menu-item.vue.js +28 -4
- package/es/pro-menu/pro-menu-item.vue2.js +2 -2
- package/es/pro-menu/pro-menu-item.vue3.js +5 -0
- package/es/pro-menu/pro-menu.vue.d.ts +1 -5
- package/es/pro-menu/pro-menu.vue.js +3 -8
- package/es/{pro-page-wrapper → pro-page-container}/index.d.ts +11 -11
- package/es/pro-page-container/index.js +14 -0
- package/es/{pro-page-wrapper/pro-page-wrapper.vue.d.ts → pro-page-container/pro-page-container.vue.d.ts} +3 -3
- package/es/{pro-page-wrapper/pro-page-wrapper.vue.js → pro-page-container/pro-page-container.vue.js} +6 -8
- package/es/pro-page-container/pro-page-container.vue2.js +4 -0
- package/es/pro-page-container/pro-page-container.vue3.js +5 -0
- package/es/style.css +24 -15
- package/package.json +1 -1
- package/src/index.ts +7 -3
- package/es/pro-page-wrapper/index.js +0 -14
- package/es/pro-page-wrapper/pro-page-wrapper.vue2.js +0 -4
- package/es/pro-page-wrapper/pro-page-wrapper.vue3.js +0 -5
|
@@ -26,7 +26,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
26
26
|
required: false;
|
|
27
27
|
default: string;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
showTabs: {
|
|
30
30
|
type: PropType<boolean>;
|
|
31
31
|
required: false;
|
|
32
32
|
default: boolean;
|
|
@@ -38,6 +38,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
38
38
|
};
|
|
39
39
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
40
40
|
collapse: (collapsed: boolean) => true;
|
|
41
|
+
keepAliveIncludeChange: (keepAliveInclude: string[]) => true;
|
|
41
42
|
}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
42
43
|
menuItems: {
|
|
43
44
|
type: PropType<IProMenuItem[]>;
|
|
@@ -64,7 +65,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
64
65
|
required: false;
|
|
65
66
|
default: string;
|
|
66
67
|
};
|
|
67
|
-
|
|
68
|
+
showTabs: {
|
|
68
69
|
type: PropType<boolean>;
|
|
69
70
|
required: false;
|
|
70
71
|
default: boolean;
|
|
@@ -76,13 +77,14 @@ declare const _sfc_main: DefineComponent<{
|
|
|
76
77
|
};
|
|
77
78
|
}>> & {
|
|
78
79
|
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
80
|
+
onKeepAliveIncludeChange?: ((keepAliveInclude: string[]) => any) | undefined;
|
|
79
81
|
}, {
|
|
80
82
|
menuItems: IProMenuItem[];
|
|
81
83
|
headerTitle: string;
|
|
82
84
|
headerLogo: string;
|
|
83
85
|
theme: "light" | "dark";
|
|
84
86
|
footerTitle: string;
|
|
85
|
-
|
|
87
|
+
showTabs: boolean;
|
|
86
88
|
siderBreakpoint: "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
|
|
87
89
|
}>;
|
|
88
90
|
export default _sfc_main;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useCssVars, toRefs, useSlots,
|
|
1
|
+
import { defineComponent, useCssVars, toRefs, useSlots, provide, ref, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createVNode, createElementVNode, unref, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
|
|
2
2
|
import { useHooks } from "./hooks.js";
|
|
3
3
|
const _hoisted_1 = ["src"];
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -29,7 +29,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
29
|
required: false,
|
|
30
30
|
default: "KeyBlade Pro"
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
showTabs: {
|
|
33
33
|
type: Boolean,
|
|
34
34
|
required: false,
|
|
35
35
|
default: true
|
|
@@ -41,45 +41,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
emits: {
|
|
44
|
-
"collapse": (collapsed) => true
|
|
44
|
+
"collapse": (collapsed) => true,
|
|
45
|
+
"keepAliveIncludeChange": (keepAliveInclude) => true
|
|
45
46
|
},
|
|
46
47
|
setup(__props, { emit }) {
|
|
47
48
|
const props = __props;
|
|
48
49
|
useCssVars((_ctx) => ({
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"48abaafb": headerHeightWidthPx,
|
|
51
|
+
"201e89d2": siderWidthPx,
|
|
52
|
+
"51630933": siderCollapsedWidthPx
|
|
52
53
|
}));
|
|
53
54
|
const prefixClsName = "keyblade-pro-layout";
|
|
54
55
|
const { menuItems } = toRefs(props);
|
|
55
56
|
const slots = useSlots();
|
|
56
57
|
const {
|
|
57
58
|
menuSelectedKeys,
|
|
58
|
-
onMenuItemClick,
|
|
59
|
-
activeMenuItem,
|
|
60
|
-
menuItemMap,
|
|
61
59
|
breadcrumbItems,
|
|
62
60
|
tabs,
|
|
61
|
+
keepAliveInclude,
|
|
62
|
+
onMenuItemClick,
|
|
63
63
|
onTabClick,
|
|
64
64
|
onTabDelete
|
|
65
65
|
} = useHooks(menuItems, {
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
const keepAliveKeys = computed(() => {
|
|
69
|
-
const keys = /* @__PURE__ */ new Set();
|
|
70
|
-
tabs.value.forEach((tab) => {
|
|
71
|
-
tab.parentNames.forEach((name) => {
|
|
72
|
-
const menuItem = menuItemMap.value[name];
|
|
73
|
-
if (menuItem == null ? void 0 : menuItem.ignoreCache) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
keys.add(menuItem.name);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
return Array.from(keys.values());
|
|
66
|
+
showTabs: props.showTabs
|
|
80
67
|
});
|
|
81
68
|
provide("ProBreadcrumbItems", breadcrumbItems);
|
|
82
|
-
provide("
|
|
69
|
+
provide("ProKeepAliveInclude", keepAliveInclude);
|
|
83
70
|
const headerHeight = 60;
|
|
84
71
|
const headerHeightWidthPx = `${headerHeight}px`;
|
|
85
72
|
const siderWidth = 220;
|
|
@@ -101,16 +88,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
101
88
|
break;
|
|
102
89
|
}
|
|
103
90
|
}, { immediate: true });
|
|
91
|
+
watch(keepAliveInclude, () => {
|
|
92
|
+
emit("keepAliveIncludeChange", keepAliveInclude.value);
|
|
93
|
+
}, { immediate: true });
|
|
104
94
|
return (_ctx, _cache) => {
|
|
105
95
|
const _component_a_typography_title = resolveComponent("a-typography-title");
|
|
106
96
|
const _component_a_space = resolveComponent("a-space");
|
|
107
97
|
const _component_a_layout_header = resolveComponent("a-layout-header");
|
|
108
98
|
const _component_kb_pro_menu = resolveComponent("kb-pro-menu");
|
|
99
|
+
const _component_icon_menu_unfold = resolveComponent("icon-menu-unfold");
|
|
100
|
+
const _component_icon_menu_fold = resolveComponent("icon-menu-fold");
|
|
101
|
+
const _component_a_button = resolveComponent("a-button");
|
|
109
102
|
const _component_a_layout_sider = resolveComponent("a-layout-sider");
|
|
110
103
|
const _component_kb_pro_reuse_tabs = resolveComponent("kb-pro-reuse-tabs");
|
|
111
104
|
const _component_a_affix = resolveComponent("a-affix");
|
|
112
|
-
const
|
|
113
|
-
const _component_kb_pro_page_wrapper = resolveComponent("kb-pro-page-wrapper");
|
|
105
|
+
const _component_kb_pro_keep_alive_router_view = resolveComponent("kb-pro-keep-alive-router-view");
|
|
114
106
|
const _component_a_layout_content = resolveComponent("a-layout-content");
|
|
115
107
|
const _component_a_layout_footer = resolveComponent("a-layout-footer");
|
|
116
108
|
const _component_a_layout = resolveComponent("a-layout");
|
|
@@ -158,8 +150,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
158
150
|
default: withCtx(() => [
|
|
159
151
|
createVNode(_component_a_layout_sider, {
|
|
160
152
|
class: normalizeClass(`${prefixClsName}-sider`),
|
|
161
|
-
collapsible: true,
|
|
162
153
|
width: siderWidth,
|
|
154
|
+
collapsible: true,
|
|
163
155
|
breakpoint: __props.siderBreakpoint,
|
|
164
156
|
collapsed: siderCollapsed.value,
|
|
165
157
|
"hide-trigger": true,
|
|
@@ -171,14 +163,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
171
163
|
}, [
|
|
172
164
|
renderSlot(_ctx.$slots, "sider-top"),
|
|
173
165
|
createVNode(_component_kb_pro_menu, {
|
|
174
|
-
style: { "flex": "1" },
|
|
175
166
|
collapsed: siderCollapsed.value,
|
|
176
167
|
"selected-keys": unref(menuSelectedKeys),
|
|
177
168
|
items: unref(menuItems),
|
|
178
|
-
onCollapse: onSiderCollapse,
|
|
179
169
|
onMenuItemClick: unref(onMenuItemClick)
|
|
180
170
|
}, null, 8, ["collapsed", "selected-keys", "items", "onMenuItemClick"])
|
|
181
|
-
], 2)
|
|
171
|
+
], 2),
|
|
172
|
+
createVNode(_component_a_button, {
|
|
173
|
+
size: "mini",
|
|
174
|
+
class: normalizeClass(`${prefixClsName}-sider-collapsed`),
|
|
175
|
+
onClick: _cache[0] || (_cache[0] = ($event) => onSiderCollapse(!siderCollapsed.value))
|
|
176
|
+
}, {
|
|
177
|
+
icon: withCtx(() => [
|
|
178
|
+
siderCollapsed.value ? (openBlock(), createBlock(_component_icon_menu_unfold, { key: 0 })) : (openBlock(), createBlock(_component_icon_menu_fold, { key: 1 }))
|
|
179
|
+
]),
|
|
180
|
+
_: 1
|
|
181
|
+
}, 8, ["class"])
|
|
182
182
|
]),
|
|
183
183
|
_: 3
|
|
184
184
|
}, 8, ["class", "breakpoint", "collapsed"]),
|
|
@@ -191,7 +191,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
191
191
|
offsetTop: headerHeight
|
|
192
192
|
}, {
|
|
193
193
|
default: withCtx(() => [
|
|
194
|
-
__props.
|
|
194
|
+
__props.showTabs && unref(tabs).length > 0 ? (openBlock(), createBlock(_component_kb_pro_reuse_tabs, {
|
|
195
195
|
key: 0,
|
|
196
196
|
tabs: unref(tabs),
|
|
197
197
|
onTabClick: unref(onTabClick),
|
|
@@ -201,34 +201,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
201
201
|
_: 1
|
|
202
202
|
}, 8, ["class"]),
|
|
203
203
|
createVNode(_component_a_layout_content, null, {
|
|
204
|
-
default: withCtx(() =>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
createVNode(_component_kb_pro_page_wrapper, {
|
|
208
|
-
"hide-page-wrapper": (_a = unref(activeMenuItem)) == null ? void 0 : _a.hidePageWrapper
|
|
209
|
-
}, {
|
|
210
|
-
default: withCtx(() => [
|
|
211
|
-
createVNode(_component_router_view, null, {
|
|
212
|
-
default: withCtx(({ Component, route }) => [
|
|
213
|
-
!__props.tabsMode ? (openBlock(), createBlock(resolveDynamicComponent(Component), {
|
|
214
|
-
key: route.fullPath
|
|
215
|
-
})) : (openBlock(), createBlock(KeepAlive, {
|
|
216
|
-
key: 1,
|
|
217
|
-
include: unref(keepAliveKeys),
|
|
218
|
-
max: 15
|
|
219
|
-
}, [
|
|
220
|
-
(openBlock(), createBlock(resolveDynamicComponent(Component), {
|
|
221
|
-
key: route.fullPath
|
|
222
|
-
}))
|
|
223
|
-
], 1032, ["include"]))
|
|
224
|
-
]),
|
|
225
|
-
_: 1
|
|
226
|
-
})
|
|
227
|
-
]),
|
|
228
|
-
_: 1
|
|
229
|
-
}, 8, ["hide-page-wrapper"])
|
|
230
|
-
];
|
|
231
|
-
}),
|
|
204
|
+
default: withCtx(() => [
|
|
205
|
+
createVNode(_component_kb_pro_keep_alive_router_view)
|
|
206
|
+
]),
|
|
232
207
|
_: 1
|
|
233
208
|
}),
|
|
234
209
|
unref(slots)["footer"] !== void 0 ? renderSlot(_ctx.$slots, "footer", { key: 0 }) : (openBlock(), createBlock(_component_a_layout_footer, {
|
package/es/pro-menu/index.d.ts
CHANGED
|
@@ -18,9 +18,7 @@ declare const ProMenu: {
|
|
|
18
18
|
required: true;
|
|
19
19
|
};
|
|
20
20
|
}>> & {
|
|
21
|
-
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
22
21
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
23
|
-
"onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
|
|
24
22
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>;
|
|
25
23
|
$attrs: {
|
|
26
24
|
[x: string]: unknown;
|
|
@@ -33,7 +31,7 @@ declare const ProMenu: {
|
|
|
33
31
|
}>;
|
|
34
32
|
$root: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
35
33
|
$parent: ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
36
|
-
$emit: (
|
|
34
|
+
$emit: (event: "menu-item-click", key: string) => void;
|
|
37
35
|
$el: any;
|
|
38
36
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
39
37
|
collapsed: {
|
|
@@ -49,13 +47,9 @@ declare const ProMenu: {
|
|
|
49
47
|
required: true;
|
|
50
48
|
};
|
|
51
49
|
}>> & {
|
|
52
|
-
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
53
50
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
54
|
-
"onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
|
|
55
51
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
56
|
-
collapse: (collapsed: boolean) => true;
|
|
57
52
|
'menu-item-click': (key: string) => true;
|
|
58
|
-
'sub-menu-click': (key: string, openKeys: string[]) => true;
|
|
59
53
|
}, string, {}, {}, string> & {
|
|
60
54
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
61
55
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -90,9 +84,7 @@ declare const ProMenu: {
|
|
|
90
84
|
required: true;
|
|
91
85
|
};
|
|
92
86
|
}>> & {
|
|
93
|
-
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
94
87
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
95
|
-
"onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
|
|
96
88
|
} & ShallowUnwrapRef<{}> & {} & ComponentCustomProperties & {};
|
|
97
89
|
__isFragment?: undefined;
|
|
98
90
|
__isTeleport?: undefined;
|
|
@@ -111,13 +103,9 @@ declare const ProMenu: {
|
|
|
111
103
|
required: true;
|
|
112
104
|
};
|
|
113
105
|
}>> & {
|
|
114
|
-
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
115
106
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
116
|
-
"onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
|
|
117
107
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
118
|
-
collapse: (collapsed: boolean) => true;
|
|
119
108
|
'menu-item-click': (key: string) => true;
|
|
120
|
-
'sub-menu-click': (key: string, openKeys: string[]) => true;
|
|
121
109
|
}, string, {}, {}, string> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
122
110
|
install: (app: App) => void;
|
|
123
111
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RenderFunction, VNode } from 'vue';
|
|
2
1
|
export interface IProMenuItem {
|
|
3
2
|
/** 英文名称(唯一标识,不能重复) */
|
|
4
3
|
name: string;
|
|
@@ -8,22 +7,19 @@ export interface IProMenuItem {
|
|
|
8
7
|
title: string;
|
|
9
8
|
/**
|
|
10
9
|
* 图标
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* RenderFunction:() => v(IconApps)
|
|
10
|
+
* arco design icon: 'icon-apps'
|
|
11
|
+
* url: 绝对路径或相对路径
|
|
14
12
|
* */
|
|
15
|
-
icon?: string
|
|
13
|
+
icon?: string;
|
|
16
14
|
/** 如果设置为 true,右侧菜单不显示 */
|
|
17
15
|
hideInMenu?: boolean;
|
|
18
16
|
/** 如果设置为 true,右侧菜单不显示下面子菜单 */
|
|
19
17
|
hideChildrenInMenu?: boolean;
|
|
20
|
-
/** 如果设置为 true
|
|
18
|
+
/** 如果设置为 true,则不会出现在多页签中 */
|
|
21
19
|
noAffix?: boolean;
|
|
22
20
|
/** 面包屑 */
|
|
23
21
|
breadcrumbs?: string[];
|
|
24
|
-
/**
|
|
25
|
-
hidePageWrapper?: boolean;
|
|
26
|
-
/** 如果设置为 true,页面将不会被缓存 */
|
|
22
|
+
/** 默认缓存,如果设置为 true,页面将不会被缓存 */
|
|
27
23
|
ignoreCache?: boolean;
|
|
28
24
|
/** 子元素 */
|
|
29
25
|
children?: IProMenuItem[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createBlock, createSlots, withCtx, createTextVNode, toDisplayString, renderList, createCommentVNode, resolveDynamicComponent } from "vue";
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createBlock, createSlots, withCtx, createTextVNode, toDisplayString, renderList, createCommentVNode, unref, resolveDynamicComponent, normalizeClass } from "vue";
|
|
2
2
|
import { useRouter } from "vue-router";
|
|
3
|
+
const _hoisted_1 = ["src"];
|
|
4
|
+
const _hoisted_2 = ["src"];
|
|
3
5
|
const __default__ = {
|
|
4
6
|
name: "KbProMenuItem"
|
|
5
7
|
};
|
|
@@ -9,7 +11,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9
11
|
item: null
|
|
10
12
|
},
|
|
11
13
|
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const prefixItemClsName = "keyblade-pro-menu-item";
|
|
12
16
|
const router = useRouter();
|
|
17
|
+
const iconType = computed(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
const icon = (_a = props.item) == null ? void 0 : _a.icon;
|
|
20
|
+
if (icon == null ? void 0 : icon.startsWith("icon")) {
|
|
21
|
+
return "icon";
|
|
22
|
+
}
|
|
23
|
+
return "url";
|
|
24
|
+
});
|
|
13
25
|
const onMenuItemClick = (item) => {
|
|
14
26
|
if (!(item == null ? void 0 : item.path)) {
|
|
15
27
|
return;
|
|
@@ -35,7 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
47
|
default: withCtx(() => {
|
|
36
48
|
var _a2, _b2;
|
|
37
49
|
return [
|
|
38
|
-
!((_a2 = __props.item) == null ? void 0 : _a2.hideChildrenInMenu) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList((_b2 = __props.item) == null ? void 0 : _b2.children, (childItem) => {
|
|
50
|
+
!((_a2 = __props.item) == null ? void 0 : _a2.hideChildrenInMenu) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(((_b2 = __props.item) == null ? void 0 : _b2.children) || [], (childItem) => {
|
|
39
51
|
return openBlock(), createBlock(_component_kb_pro_menu_item, {
|
|
40
52
|
key: childItem.name,
|
|
41
53
|
item: childItem
|
|
@@ -48,7 +60,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
48
60
|
((_d = __props.item) == null ? void 0 : _d.icon) ? {
|
|
49
61
|
name: "icon",
|
|
50
62
|
fn: withCtx(() => [
|
|
51
|
-
(openBlock(), createBlock(resolveDynamicComponent(__props.item.icon)))
|
|
63
|
+
unref(iconType) === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.icon), { key: 0 })) : createCommentVNode("", true),
|
|
64
|
+
unref(iconType) === "url" ? (openBlock(), createElementBlock("img", {
|
|
65
|
+
key: 1,
|
|
66
|
+
class: normalizeClass(`${prefixItemClsName}-img`),
|
|
67
|
+
src: __props.item.icon,
|
|
68
|
+
alt: ""
|
|
69
|
+
}, null, 10, _hoisted_1)) : createCommentVNode("", true)
|
|
52
70
|
]),
|
|
53
71
|
key: "0"
|
|
54
72
|
} : void 0
|
|
@@ -65,7 +83,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
83
|
((_h = __props.item) == null ? void 0 : _h.icon) ? {
|
|
66
84
|
name: "icon",
|
|
67
85
|
fn: withCtx(() => [
|
|
68
|
-
(openBlock(), createBlock(resolveDynamicComponent(__props.item.icon)))
|
|
86
|
+
unref(iconType) === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(__props.item.icon), { key: 0 })) : createCommentVNode("", true),
|
|
87
|
+
unref(iconType) === "url" ? (openBlock(), createElementBlock("img", {
|
|
88
|
+
key: 1,
|
|
89
|
+
class: normalizeClass(`${prefixItemClsName}-img`),
|
|
90
|
+
src: __props.item.icon,
|
|
91
|
+
alt: ""
|
|
92
|
+
}, null, 10, _hoisted_2)) : createCommentVNode("", true)
|
|
69
93
|
]),
|
|
70
94
|
key: "0"
|
|
71
95
|
} : void 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IProMenuItem } from './interface';
|
|
2
1
|
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, type PropType } from 'vue';
|
|
2
|
+
import type { IProMenuItem } from './interface';
|
|
3
3
|
declare const _sfc_main: DefineComponent<{
|
|
4
4
|
collapsed: {
|
|
5
5
|
type: PropType<boolean>;
|
|
@@ -14,9 +14,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
14
14
|
required: true;
|
|
15
15
|
};
|
|
16
16
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
-
collapse: (collapsed: boolean) => true;
|
|
18
17
|
'menu-item-click': (key: string) => true;
|
|
19
|
-
'sub-menu-click': (key: string, openKeys: string[]) => true;
|
|
20
18
|
}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
21
19
|
collapsed: {
|
|
22
20
|
type: PropType<boolean>;
|
|
@@ -31,8 +29,6 @@ declare const _sfc_main: DefineComponent<{
|
|
|
31
29
|
required: true;
|
|
32
30
|
};
|
|
33
31
|
}>> & {
|
|
34
|
-
onCollapse?: ((collapsed: boolean) => any) | undefined;
|
|
35
32
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
36
|
-
"onSub-menu-click"?: ((key: string, openKeys: string[]) => any) | undefined;
|
|
37
33
|
}, {}>;
|
|
38
34
|
export default _sfc_main;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementBlock, Fragment, renderList } from "vue";
|
|
2
2
|
import _sfc_main$1 from "./pro-menu-item.vue.js";
|
|
3
|
+
import "./pro-menu-item.vue2.js";
|
|
3
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
5
|
__name: "pro-menu",
|
|
5
6
|
props: {
|
|
@@ -17,9 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
emits: {
|
|
20
|
-
"
|
|
21
|
-
"menu-item-click": (key) => true,
|
|
22
|
-
"sub-menu-click": (key, openKeys) => true
|
|
21
|
+
"menu-item-click": (key) => true
|
|
23
22
|
},
|
|
24
23
|
setup(__props, { emit }) {
|
|
25
24
|
const props = __props;
|
|
@@ -51,12 +50,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
50
|
class: normalizeClass(prefixClsName),
|
|
52
51
|
collapsed: __props.collapsed,
|
|
53
52
|
"selected-keys": __props.selectedKeys,
|
|
54
|
-
"show-collapse-button": "",
|
|
55
53
|
"auto-open-selected": "",
|
|
56
|
-
|
|
57
|
-
onCollapse: _cache[0] || (_cache[0] = ($event) => emit("collapse", $event)),
|
|
58
|
-
onMenuItemClick,
|
|
59
|
-
onSubMenuClick: _cache[1] || (_cache[1] = (_key, _openKeys) => emit("sub-menu-click", _key, _openKeys))
|
|
54
|
+
onMenuItemClick
|
|
60
55
|
}, {
|
|
61
56
|
default: withCtx(() => [
|
|
62
57
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ComponentInternalInstance, ExtractPropTypes, PropType, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, App } from 'vue';
|
|
2
|
-
declare const
|
|
2
|
+
declare const ProPageContainer: {
|
|
3
3
|
new (...args: any[]): {
|
|
4
4
|
$: ComponentInternalInstance;
|
|
5
5
|
$data: {};
|
|
6
6
|
$props: Partial<{
|
|
7
|
-
|
|
7
|
+
hideBreadcrumb: boolean;
|
|
8
8
|
breadcrumbItems: string[];
|
|
9
9
|
}> & Omit<Readonly<ExtractPropTypes<{
|
|
10
|
-
|
|
10
|
+
hideBreadcrumb: {
|
|
11
11
|
type: PropType<boolean>;
|
|
12
12
|
required: false;
|
|
13
13
|
default: boolean;
|
|
@@ -17,7 +17,7 @@ declare const ProPageWrapper: {
|
|
|
17
17
|
required: false;
|
|
18
18
|
default: () => never[];
|
|
19
19
|
};
|
|
20
|
-
}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "
|
|
20
|
+
}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "hideBreadcrumb" | "breadcrumbItems">;
|
|
21
21
|
$attrs: {
|
|
22
22
|
[x: string]: unknown;
|
|
23
23
|
};
|
|
@@ -32,7 +32,7 @@ declare const ProPageWrapper: {
|
|
|
32
32
|
$emit: (event: string, ...args: any[]) => void;
|
|
33
33
|
$el: any;
|
|
34
34
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
35
|
-
|
|
35
|
+
hideBreadcrumb: {
|
|
36
36
|
type: PropType<boolean>;
|
|
37
37
|
required: false;
|
|
38
38
|
default: boolean;
|
|
@@ -43,7 +43,7 @@ declare const ProPageWrapper: {
|
|
|
43
43
|
default: () => never[];
|
|
44
44
|
};
|
|
45
45
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
46
|
-
|
|
46
|
+
hideBreadcrumb: boolean;
|
|
47
47
|
breadcrumbItems: string[];
|
|
48
48
|
}, {}, string> & {
|
|
49
49
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -66,7 +66,7 @@ declare const ProPageWrapper: {
|
|
|
66
66
|
$nextTick: typeof nextTick;
|
|
67
67
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
68
68
|
} & Readonly<ExtractPropTypes<{
|
|
69
|
-
|
|
69
|
+
hideBreadcrumb: {
|
|
70
70
|
type: PropType<boolean>;
|
|
71
71
|
required: false;
|
|
72
72
|
default: boolean;
|
|
@@ -81,7 +81,7 @@ declare const ProPageWrapper: {
|
|
|
81
81
|
__isTeleport?: undefined;
|
|
82
82
|
__isSuspense?: undefined;
|
|
83
83
|
} & ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
84
|
-
|
|
84
|
+
hideBreadcrumb: {
|
|
85
85
|
type: PropType<boolean>;
|
|
86
86
|
required: false;
|
|
87
87
|
default: boolean;
|
|
@@ -92,10 +92,10 @@ declare const ProPageWrapper: {
|
|
|
92
92
|
default: () => never[];
|
|
93
93
|
};
|
|
94
94
|
}>>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
95
|
-
|
|
95
|
+
hideBreadcrumb: boolean;
|
|
96
96
|
breadcrumbItems: string[];
|
|
97
97
|
}, {}, string> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
98
98
|
install: (app: App) => void;
|
|
99
99
|
};
|
|
100
|
-
export {
|
|
101
|
-
export default
|
|
100
|
+
export { ProPageContainer };
|
|
101
|
+
export default ProPageContainer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _sfc_main from "./pro-page-container.vue.js";
|
|
2
|
+
import "./pro-page-container.vue2.js";
|
|
3
|
+
import { ProBreadcrumb } from "../pro-breadcrumb/index.js";
|
|
4
|
+
const ProPageContainer = Object.assign(_sfc_main, {
|
|
5
|
+
install: (app) => {
|
|
6
|
+
app.use(ProBreadcrumb);
|
|
7
|
+
app.component("KbProPageContainer", _sfc_main);
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
const ProPageContainer$1 = ProPageContainer;
|
|
11
|
+
export {
|
|
12
|
+
ProPageContainer,
|
|
13
|
+
ProPageContainer$1 as default
|
|
14
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
declare const _sfc_main: DefineComponent<{
|
|
3
3
|
/** 是否隐藏面包屑 */
|
|
4
|
-
|
|
4
|
+
hideBreadcrumb: {
|
|
5
5
|
type: PropType<boolean>;
|
|
6
6
|
required: false;
|
|
7
7
|
default: boolean;
|
|
@@ -14,7 +14,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
14
14
|
};
|
|
15
15
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
16
16
|
/** 是否隐藏面包屑 */
|
|
17
|
-
|
|
17
|
+
hideBreadcrumb: {
|
|
18
18
|
type: PropType<boolean>;
|
|
19
19
|
required: false;
|
|
20
20
|
default: boolean;
|
|
@@ -26,7 +26,7 @@ declare const _sfc_main: DefineComponent<{
|
|
|
26
26
|
default: () => never[];
|
|
27
27
|
};
|
|
28
28
|
}>>, {
|
|
29
|
-
|
|
29
|
+
hideBreadcrumb: boolean;
|
|
30
30
|
breadcrumbItems: string[];
|
|
31
31
|
}>;
|
|
32
32
|
export default _sfc_main;
|
package/es/{pro-page-wrapper/pro-page-wrapper.vue.js → pro-page-container/pro-page-container.vue.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot } from "vue";
|
|
2
2
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
-
__name: "pro-page-
|
|
3
|
+
__name: "pro-page-container",
|
|
4
4
|
props: {
|
|
5
5
|
/** 是否隐藏面包屑 */
|
|
6
|
-
|
|
6
|
+
hideBreadcrumb: {
|
|
7
7
|
type: Boolean,
|
|
8
8
|
required: false,
|
|
9
9
|
default: false
|
|
@@ -16,20 +16,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
setup(__props) {
|
|
19
|
-
const prefixClsName = "keyblade-pro-page-
|
|
20
|
-
const prefixClsHideName = "keyblade-pro-page-wrapper-hide";
|
|
19
|
+
const prefixClsName = "keyblade-pro-page-container";
|
|
21
20
|
return (_ctx, _cache) => {
|
|
22
21
|
const _component_kb_pro_breadcrumb = resolveComponent("kb-pro-breadcrumb");
|
|
23
22
|
return openBlock(), createElementBlock("div", {
|
|
24
|
-
class: normalizeClass(
|
|
23
|
+
class: normalizeClass(prefixClsName)
|
|
25
24
|
}, [
|
|
26
|
-
!__props.
|
|
25
|
+
!__props.hideBreadcrumb ? (openBlock(), createBlock(_component_kb_pro_breadcrumb, {
|
|
27
26
|
key: 0,
|
|
28
|
-
style: { "margin": "16px 0" },
|
|
29
27
|
items: __props.breadcrumbItems
|
|
30
28
|
}, null, 8, ["items"])) : createCommentVNode("", true),
|
|
31
29
|
renderSlot(_ctx.$slots, "default")
|
|
32
|
-
]
|
|
30
|
+
]);
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
});
|