kui-vue 3.6.4 → 3.6.7
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/components/alert/alert.jsx +26 -7
- package/components/alert/demo/basic.md +4 -4
- package/components/alert/demo/icon.md +15 -6
- package/components/alert/styles/index.less +42 -14
- package/components/avatar/styles/index.less +4 -4
- package/components/backtop/styles/index.less +10 -14
- package/components/badge/styles/index.less +7 -13
- package/components/breadcrumb/index.md +7 -6
- package/components/breadcrumb/styles/index.less +7 -21
- package/components/button/demo/color.md +0 -1
- package/components/button/demo/disabled.md +6 -0
- package/components/button/demo/light.md +1 -1
- package/components/button/styles/index.less +165 -111
- package/components/card/card.jsx +1 -1
- package/components/card/demo/basic.md +1 -1
- package/components/card/demo/border.md +1 -1
- package/components/card/demo/notitle.md +1 -1
- package/components/card/styles/index.less +5 -4
- package/components/carousel/carousel.jsx +186 -175
- package/components/carousel/styles/index.less +11 -16
- package/components/checkbox/checkbox.jsx +2 -2
- package/components/checkbox/styles/index.less +21 -29
- package/components/collapse/styles/index.less +7 -11
- package/components/colorPicker/styles/index.less +83 -71
- package/components/config/context.js +21 -0
- package/components/config/index.js +10 -2
- package/components/datePicker/datepicker.jsx +6 -2
- package/components/datePicker/styles/index.less +54 -57
- package/components/descriptions/styles/index.less +8 -17
- package/components/divider/styles/index.less +20 -18
- package/components/drawer/demo/target.md +1 -0
- package/components/drawer/styles/animal.less +0 -1
- package/components/drawer/styles/index.less +8 -11
- package/components/dropdown/demo/cascading.md +30 -16
- package/components/dropdown/styles/index.less +26 -34
- package/components/empty/index.md +3 -2
- package/components/empty/styles/index.less +2 -2
- package/components/flex/demo/align.md +1 -1
- package/components/flex/demo/basic.md +1 -2
- package/components/flex/index.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -3
- package/components/form/demo/info.md +22 -12
- package/components/form/demo/valid.md +6 -6
- package/components/form/demo/withmodal.md +6 -6
- package/components/form/styles/index.less +10 -11
- package/components/grid/index.md +4 -1
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/search.vue +44 -21
- package/components/icon/index.md +1 -1
- package/components/icon/styles/index.less +7 -8
- package/components/image/index.md +7 -1
- package/components/image/preview.jsx +17 -4
- package/components/image/styles/index.less +36 -42
- package/components/index.js +9 -9
- package/components/input/demo/icon.md +0 -1
- package/components/input/demo/suffix.md +2 -7
- package/components/input/input.jsx +31 -29
- package/components/input/inputBox.jsx +13 -0
- package/components/input/inputGroup.jsx +2 -0
- package/components/input/styles/index.less +47 -53
- package/components/input/textarea.jsx +1 -1
- package/components/inputNumber/demo/basic.md +3 -3
- package/components/inputNumber/demo/ffix.md +2 -2
- package/components/inputNumber/inputNumber.jsx +2 -2
- package/components/inputNumber/styles/index.less +36 -42
- package/components/layout/demo/basic.md +5 -5
- package/components/layout/demo/info.md +1 -34
- package/components/layout/demo/layout1.md +7 -7
- package/components/layout/demo/layout2.md +32 -20
- package/components/layout/demo/layout3.md +20 -13
- package/components/layout/demo/layout4.md +12 -8
- package/components/layout/demo/layout5.md +6 -2
- package/components/layout/styles/index.less +1 -18
- package/components/loading/demo/info.md +3 -3
- package/components/loading/styles/index.less +31 -31
- package/components/menu/demo/accordion.md +44 -22
- package/components/menu/demo/basic.md +35 -20
- package/components/menu/demo/collapsed.md +37 -19
- package/components/menu/demo/inline.md +44 -23
- package/components/menu/demo/mode.md +42 -26
- package/components/menu/demo/theme.md +34 -18
- package/components/menu/demo/vertical.md +34 -18
- package/components/menu/index.md +14 -3
- package/components/menu/menu.jsx +9 -3
- package/components/menu/menuitem.jsx +4 -4
- package/components/menu/recursiveMenu.jsx +40 -0
- package/components/menu/styles/index.less +46 -58
- package/components/message/demo/basic.md +0 -7
- package/components/message/index.js +0 -4
- package/components/message/index.md +0 -1
- package/components/message/inner.jsx +15 -2
- package/components/message/styles/index.less +12 -17
- package/components/modal/demo/confirm.md +6 -6
- package/components/modal/demo/global.md +0 -15
- package/components/modal/demo/info.md +0 -1
- package/components/modal/index.js +5 -34
- package/components/modal/index.md +1 -2
- package/components/modal/modal.jsx +2 -1
- package/components/modal/styles/index.less +14 -21
- package/components/notice/demo/basic.md +0 -9
- package/components/notice/demo/close.md +4 -0
- package/components/notice/demo/types.md +1 -2
- package/components/notice/index.js +1 -19
- package/components/notice/styles/index.less +16 -22
- package/components/page/page.jsx +5 -4
- package/components/page/styles/index.less +49 -50
- package/components/popconfirm/demo/basic.md +11 -18
- package/components/popconfirm/demo/info.md +3 -1
- package/components/popconfirm/demo/local.md +14 -20
- package/components/popconfirm/demo/placement.md +3 -9
- package/components/popconfirm/index.md +3 -2
- package/components/popconfirm/styles/index.less +9 -15
- package/components/poptip/styles/index.less +44 -49
- package/components/progress/styles/index.less +13 -13
- package/components/radio/index.md +7 -7
- package/components/radio/radio.jsx +5 -1
- package/components/radio/styles/index.less +26 -32
- package/components/rate/index.md +11 -11
- package/components/rate/styles/index.less +4 -7
- package/components/select/select.jsx +2 -2
- package/components/select/styles/index.less +37 -50
- package/components/skeleton/index.md +5 -1
- package/components/skeleton/styles/index.less +21 -19
- package/components/slider/slider.jsx +25 -13
- package/components/slider/styles/index.less +13 -12
- package/components/space/space.jsx +2 -1
- package/components/spin/styles/index.less +25 -40
- package/components/statCard/demo/card.md +18 -4
- package/components/statCard/index.md +5 -5
- package/components/statCard/statCard.jsx +4 -1
- package/components/statCard/styles/index.less +9 -6
- package/components/styles/less-css-var.less +305 -0
- package/components/styles/less-var.less +296 -0
- package/components/styles/sys.less +19 -15
- package/components/switch/styles/index.less +9 -24
- package/components/table/index.md +1 -1
- package/components/table/styles/index.less +63 -59
- package/components/table/table.jsx +1 -1
- package/components/tabs/styles/index.less +22 -24
- package/components/tag/demo/basic.md +0 -8
- package/components/tag/index.md +2 -1
- package/components/tag/styles/index.less +40 -41
- package/components/tag/tag.jsx +2 -2
- package/components/timeline/styles/index.less +8 -14
- package/components/tooltip/styles/index.less +35 -40
- package/components/tree/index.md +15 -15
- package/components/tree/styles/index.less +36 -56
- package/components/tree/tree.jsx +1 -0
- package/components/treeselect/index.md +1 -1
- package/components/treeselect/styles/index.less +26 -32
- package/components/treeselect/treeselect.jsx +3 -3
- package/components/upload/demo/forms.md +0 -1
- package/components/upload/fileList.jsx +6 -3
- package/components/upload/styles/index.less +33 -29
- package/components/upload/upload.jsx +5 -1
- package/components/utils/vue.js +4 -2
- package/dist/k-ui.cjs.js +3 -2
- package/dist/k-ui.css +4 -3
- package/dist/k-ui.d.ts +71 -54
- package/dist/k-ui.esm.js +3 -2
- package/dist/k-ui.umd.js +3 -2
- package/dist/locale/de.js +2 -1
- package/dist/locale/el.js +2 -1
- package/dist/locale/en.js +2 -1
- package/dist/locale/fr.js +2 -1
- package/dist/locale/it.js +2 -1
- package/dist/locale/ja.js +2 -1
- package/dist/locale/ko.js +2 -1
- package/dist/locale/ru.js +2 -1
- package/dist/locale/th.js +2 -1
- package/dist/locale/uk.js +2 -1
- package/dist/locale/vi.js +2 -1
- package/dist/locale/zh-CN.js +2 -1
- package/dist/locale/zh-TW.js +2 -1
- package/package.json +14 -16
- package/types/alert/Alert.d.ts +2 -0
- package/types/card/Card.d.ts +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -0
- package/types/datePicker/DatePicker.d.ts +1 -0
- package/types/index.d.ts +6 -6
- package/types/input/Input.d.ts +1 -0
- package/types/input/InputGroup.d.ts +2 -0
- package/types/input/TextArea.d.ts +1 -0
- package/types/inputNumber/InputNumber.d.ts +1 -0
- package/types/menu/Menu.d.ts +1 -0
- package/types/page/Page.d.ts +1 -0
- package/types/select/Select.d.ts +1 -0
- package/types/statCard/StatCard.d.ts +2 -0
- package/types/table/Table.d.ts +1 -1
- package/types/tag/Tag.d.ts +1 -0
- package/types/treeselect/TreeSelect.d.ts +1 -0
- package/components/dropdown/demo/custom.md +0 -31
- package/components/icon/lib/dist.json +0 -1
- package/components/icon/lib/kui-icons.js +0 -1
- package/components/icon/lib/sprite.svg +0 -1
- package/components/styles/color.less +0 -209
- package/components/styles/var.less +0 -207
|
@@ -11,28 +11,8 @@
|
|
|
11
11
|
:openKeys="openKeys"
|
|
12
12
|
mode="inline"
|
|
13
13
|
@openChange="openChange"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<MenuItem key="1-1" :icon="Heart">Option 1</MenuItem>
|
|
17
|
-
<MenuItem key="1-2" :icon="Heart">Option 2</MenuItem>
|
|
18
|
-
<MenuItem key="1-3" :icon="Heart">Option 3</MenuItem>
|
|
19
|
-
<MenuItem key="1-4" :icon="Heart">Option 4</MenuItem>
|
|
20
|
-
</SubMenu>
|
|
21
|
-
<SubMenu key="sub2" :icon="Heart" title="Navigation Two">
|
|
22
|
-
<MenuItem key="2-1">Option 5</MenuItem>
|
|
23
|
-
<MenuItem key="2-2">Option 6</MenuItem>
|
|
24
|
-
<SubMenu key="sub2-1" title="SubMenu">
|
|
25
|
-
<MenuItem key="2-3">Option 7</MenuItem>
|
|
26
|
-
<MenuItem key="2-4">Option 8</MenuItem>
|
|
27
|
-
</SubMenu>
|
|
28
|
-
</SubMenu>
|
|
29
|
-
<SubMenu key="sub3" :icon="Settings" title="Navigation Three">
|
|
30
|
-
<MenuItem key="3-1">Option 9</MenuItem>
|
|
31
|
-
<MenuItem key="3-2">Option 10</MenuItem>
|
|
32
|
-
<MenuItem key="3-3">Option 11</MenuItem>
|
|
33
|
-
<MenuItem key="3-4">Option 12</MenuItem>
|
|
34
|
-
</SubMenu>
|
|
35
|
-
</Menu>
|
|
14
|
+
:items="items"
|
|
15
|
+
/>
|
|
36
16
|
</div>
|
|
37
17
|
</template>
|
|
38
18
|
<script setup>
|
|
@@ -42,6 +22,47 @@ const current = ref(["1-1"]);
|
|
|
42
22
|
const openKeys = ref(["sub1"]);
|
|
43
23
|
const openChange = (openKeys) => {
|
|
44
24
|
console.log(openKeys);
|
|
45
|
-
}
|
|
25
|
+
};
|
|
26
|
+
const items = [
|
|
27
|
+
{
|
|
28
|
+
key: "sub1",
|
|
29
|
+
icon: Mail,
|
|
30
|
+
title: "Navigation One",
|
|
31
|
+
children: [
|
|
32
|
+
{ key: "1-1", icon: Heart, title: "Option " },
|
|
33
|
+
{ key: "1-2", icon: Heart, title: "Option 2" },
|
|
34
|
+
{ key: "1-3", icon: Heart, title: "Option 3" },
|
|
35
|
+
{ key: "1-4", icon: Heart, title: "Option 4" },
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "sub2",
|
|
40
|
+
icon: Heart,
|
|
41
|
+
title: "Navigation Two",
|
|
42
|
+
children: [
|
|
43
|
+
{ key: "2-1", title: "Option 5" },
|
|
44
|
+
{ key: "2-2", title: "Option 6" },
|
|
45
|
+
{
|
|
46
|
+
key: "sub2-1",
|
|
47
|
+
title: "SubMenu",
|
|
48
|
+
children: [
|
|
49
|
+
{ key: "2-3", title: "Option 7" },
|
|
50
|
+
{ key: "2-4", title: "Option 8" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "sub3",
|
|
57
|
+
icon: Settings,
|
|
58
|
+
title: "Navigation Three",
|
|
59
|
+
children: [
|
|
60
|
+
{ key: "3-1", title: "Option 9" },
|
|
61
|
+
{ key: "3-2", title: "Option 10" },
|
|
62
|
+
{ key: "3-3", title: "Option 11" },
|
|
63
|
+
{ key: "3-4", title: "Option 12" },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
];
|
|
46
67
|
</script>
|
|
47
68
|
```
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<Space>
|
|
10
|
+
<Button @click="changeMode">Change Mode</Button>
|
|
11
|
+
<Button @click="changeTheme"> Change Theme </Button>
|
|
12
|
+
</Space>
|
|
12
13
|
<br />
|
|
13
14
|
<br />
|
|
14
15
|
<Menu
|
|
@@ -17,24 +18,8 @@
|
|
|
17
18
|
:theme="theme"
|
|
18
19
|
:mode="mode"
|
|
19
20
|
style="width:256px"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<MenuItem key="1-2" :icon="Grid"><span>Option 2</span></MenuItem>
|
|
23
|
-
<SubMenu key="sub2" :icon="Heart" title="Navigation Two">
|
|
24
|
-
<MenuItem key="2-1">Option 5</MenuItem>
|
|
25
|
-
<MenuItem key="2-2">Option 6</MenuItem>
|
|
26
|
-
<SubMenu key="sub2-1" title="SubMenu">
|
|
27
|
-
<MenuItem key="2-3">Option 7</MenuItem>
|
|
28
|
-
<MenuItem key="2-4">Option 8</MenuItem>
|
|
29
|
-
</SubMenu>
|
|
30
|
-
</SubMenu>
|
|
31
|
-
<SubMenu key="sub3" :icon="Settings" title="Navigation Three">
|
|
32
|
-
<MenuItem key="3-1">Option 9</MenuItem>
|
|
33
|
-
<MenuItem key="3-2">Option 10</MenuItem>
|
|
34
|
-
<MenuItem key="3-3">Option 11</MenuItem>
|
|
35
|
-
<MenuItem key="3-4">Option 12</MenuItem>
|
|
36
|
-
</SubMenu>
|
|
37
|
-
</Menu>
|
|
21
|
+
:items="items"
|
|
22
|
+
/>
|
|
38
23
|
</div>
|
|
39
24
|
</template>
|
|
40
25
|
<script setup>
|
|
@@ -44,13 +29,44 @@ const current = ref(["1-1"]);
|
|
|
44
29
|
const openKeys = ref(["sub2"]);
|
|
45
30
|
const mode = ref("inline");
|
|
46
31
|
const theme = ref("light");
|
|
47
|
-
const checked = ref(false);
|
|
48
32
|
|
|
49
|
-
const changeMode = (
|
|
50
|
-
mode.value =
|
|
33
|
+
const changeMode = () => {
|
|
34
|
+
mode.value = mode.value == "inline" ? "vertical" : "inline";
|
|
51
35
|
};
|
|
52
|
-
const changeTheme = (
|
|
53
|
-
theme.value =
|
|
36
|
+
const changeTheme = () => {
|
|
37
|
+
theme.value = theme.value == "light" ? "dark" : "light";
|
|
54
38
|
};
|
|
39
|
+
const items = [
|
|
40
|
+
{ key: "1-1", icon: Mail, title: "Option 1" },
|
|
41
|
+
{ key: "1-2", icon: Grid, title: "Option 2" },
|
|
42
|
+
{
|
|
43
|
+
key: "sub2",
|
|
44
|
+
icon: Heart,
|
|
45
|
+
title: "Navigation Two",
|
|
46
|
+
children: [
|
|
47
|
+
{ key: "2-1", title: "Option 5" },
|
|
48
|
+
{ key: "2-2", title: "Option 6" },
|
|
49
|
+
{
|
|
50
|
+
key: "sub2-1",
|
|
51
|
+
title: "SubMenu",
|
|
52
|
+
children: [
|
|
53
|
+
{ key: "2-3", title: "Option 7" },
|
|
54
|
+
{ key: "2-4", title: "Option 8" },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "sub3",
|
|
61
|
+
icon: Settings,
|
|
62
|
+
title: "Navigation Three",
|
|
63
|
+
children: [
|
|
64
|
+
{ key: "3-1", title: "Option 9" },
|
|
65
|
+
{ key: "3-2", title: "Option 10" },
|
|
66
|
+
{ key: "3-3", title: "Option 11" },
|
|
67
|
+
{ key: "3-4", title: "Option 12" },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
];
|
|
55
71
|
</script>
|
|
56
72
|
```
|
|
@@ -19,24 +19,8 @@
|
|
|
19
19
|
:openKeys="openKeys"
|
|
20
20
|
:theme="theme"
|
|
21
21
|
mode="inline"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<MenuItem key="1-2" :icon="Grid">Option 2</MenuItem>
|
|
25
|
-
<SubMenu key="sub2" :icon="Heart" title="Navigation Two">
|
|
26
|
-
<MenuItem key="2-1">Option 5</MenuItem>
|
|
27
|
-
<MenuItem key="2-2">Option 6</MenuItem>
|
|
28
|
-
<SubMenu key="sub2-1" title="SubMenu">
|
|
29
|
-
<MenuItem key="2-3">Option 7</MenuItem>
|
|
30
|
-
<MenuItem key="2-4">Option 8</MenuItem>
|
|
31
|
-
</SubMenu>
|
|
32
|
-
</SubMenu>
|
|
33
|
-
<SubMenu key="sub3" :icon="Settings" title="Navigation Three">
|
|
34
|
-
<MenuItem key="3-1">Option 9</MenuItem>
|
|
35
|
-
<MenuItem key="3-2">Option 10</MenuItem>
|
|
36
|
-
<MenuItem key="3-3">Option 11</MenuItem>
|
|
37
|
-
<MenuItem key="3-4">Option 12</MenuItem>
|
|
38
|
-
</SubMenu>
|
|
39
|
-
</Menu>
|
|
22
|
+
:items="items"
|
|
23
|
+
/>
|
|
40
24
|
</div>
|
|
41
25
|
</template>
|
|
42
26
|
<script setup>
|
|
@@ -49,5 +33,37 @@ const theme = ref("dark");
|
|
|
49
33
|
const change = (checked) => {
|
|
50
34
|
theme.value = checked ? "dark" : "light";
|
|
51
35
|
};
|
|
36
|
+
const items = [
|
|
37
|
+
{ key: "1-1", icon: Mail, title: "Option 1" },
|
|
38
|
+
{ key: "1-2", icon: Grid, title: "Option 2" },
|
|
39
|
+
{
|
|
40
|
+
key: "sub2",
|
|
41
|
+
icon: Heart,
|
|
42
|
+
title: "Navigation Two",
|
|
43
|
+
children: [
|
|
44
|
+
{ key: "2-1", title: "Option 5" },
|
|
45
|
+
{ key: "2-2", title: "Option 6" },
|
|
46
|
+
{
|
|
47
|
+
key: "sub2-1",
|
|
48
|
+
title: "SubMenu",
|
|
49
|
+
children: [
|
|
50
|
+
{ key: "2-3", title: "Option 7" },
|
|
51
|
+
{ key: "2-4", title: "Option 8" },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: "sub3",
|
|
58
|
+
icon: Settings,
|
|
59
|
+
title: "Navigation Three",
|
|
60
|
+
children: [
|
|
61
|
+
{ key: "3-1", title: "Option 9" },
|
|
62
|
+
{ key: "3-2", title: "Option 10" },
|
|
63
|
+
{ key: "3-3", title: "Option 11" },
|
|
64
|
+
{ key: "3-4", title: "Option 12" },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
];
|
|
52
68
|
</script>
|
|
53
69
|
```
|
|
@@ -6,29 +6,45 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div style="width:256px">
|
|
9
|
-
<Menu v-model="current" mode="vertical"
|
|
10
|
-
<MenuItem key="1-1" :icon="Mail">Option 1</MenuItem>
|
|
11
|
-
<MenuItem key="1-2" :icon="Grid">Option 2</MenuItem>
|
|
12
|
-
<SubMenu key="sub2" :icon="Heart" title="Navigation Two">
|
|
13
|
-
<MenuItem key="2-1">Option 5</MenuItem>
|
|
14
|
-
<MenuItem key="2-2">Option 6</MenuItem>
|
|
15
|
-
<SubMenu key="sub2-1" title="SubMenu">
|
|
16
|
-
<MenuItem key="2-3">Option 7</MenuItem>
|
|
17
|
-
<MenuItem key="2-4">Option 8</MenuItem>
|
|
18
|
-
</SubMenu>
|
|
19
|
-
</SubMenu>
|
|
20
|
-
<SubMenu key="sub3" :icon="Settings" title="Navigation Three">
|
|
21
|
-
<MenuItem key="3-1">Option 9</MenuItem>
|
|
22
|
-
<MenuItem key="3-2">Option 10</MenuItem>
|
|
23
|
-
<MenuItem key="3-3">Option 11</MenuItem>
|
|
24
|
-
<MenuItem key="3-4">Option 12</MenuItem>
|
|
25
|
-
</SubMenu>
|
|
26
|
-
</Menu>
|
|
9
|
+
<Menu v-model="current" mode="vertical" :items="items" />
|
|
27
10
|
</div>
|
|
28
11
|
</template>
|
|
29
12
|
<script setup>
|
|
30
13
|
import { ref } from "vue";
|
|
31
14
|
import { Mail, Grid, Heart, Settings } from "kui-icons";
|
|
32
15
|
const current = ref(["1-1"]);
|
|
16
|
+
|
|
17
|
+
const items = [
|
|
18
|
+
{ key: "1-1", icon: Mail, title: "Option 1" },
|
|
19
|
+
{ key: "1-2", icon: Grid, title: "Option 2" },
|
|
20
|
+
{
|
|
21
|
+
key: "sub2",
|
|
22
|
+
icon: Heart,
|
|
23
|
+
title: "Navigation Two",
|
|
24
|
+
children: [
|
|
25
|
+
{ key: "2-1", title: "Option 5" },
|
|
26
|
+
{ key: "2-2", title: "Option 6" },
|
|
27
|
+
{
|
|
28
|
+
key: "sub2-1",
|
|
29
|
+
title: "SubMenu",
|
|
30
|
+
children: [
|
|
31
|
+
{ key: "2-3", title: "Option 7" },
|
|
32
|
+
{ key: "2-4", title: "Option 8" },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "sub3",
|
|
39
|
+
icon: Settings,
|
|
40
|
+
title: "Navigation Three",
|
|
41
|
+
children: [
|
|
42
|
+
{ key: "3-1", title: "Option 9" },
|
|
43
|
+
{ key: "3-2", title: "Option 10" },
|
|
44
|
+
{ key: "3-3", title: "Option 11" },
|
|
45
|
+
{ key: "3-4", title: "Option 12" },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
33
49
|
</script>
|
|
34
50
|
```
|
package/components/menu/index.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| -------------------- | ---------------------------------------- | ------------------------------------------------- | -------- |
|
|
7
7
|
| value(v-model) | 当前选中的菜单项 | String: [] | light |
|
|
8
8
|
| theme | 主题颜色 | String: light dark | light |
|
|
9
|
+
| items | 菜单数据 | Array | - |
|
|
9
10
|
| v-model:openKeys | 当前展开的 SubMenu 菜单项 key 数组 | String[] | - |
|
|
10
11
|
| v-model:selectedKeys | 当前选中的菜单项,可使用 v-model 绑定 | String[] | - |
|
|
11
12
|
| mode | 菜单类型,支持垂直、水平、和内嵌模式三种 | String: vertical vertical-right horizontal inline | vertical |
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
| accordion | 是否只允许菜单展开一项 | Boolean | false |
|
|
15
16
|
| inline-collapsed | inline 时菜单是否收起状态 | Boolean | false |
|
|
16
17
|
|
|
17
|
-
### Menu
|
|
18
|
+
### Menu(items)
|
|
18
19
|
|
|
19
20
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
20
21
|
| -------- | ------------------------ | ------- | ------ |
|
|
@@ -22,8 +23,18 @@
|
|
|
22
23
|
| disabled | 是否禁用 | Boolean | false |
|
|
23
24
|
| key | item 的唯一标志 | String | - |
|
|
24
25
|
| title | 设置收缩时展示的悬浮标题 | String | - |
|
|
26
|
+
| children | 菜单子集 | Array | - |
|
|
25
27
|
|
|
26
|
-
###
|
|
28
|
+
### MenuItem
|
|
29
|
+
|
|
30
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
31
|
+
| -------- | ------------------------ | ------- | ------ |
|
|
32
|
+
| icon | item 的图标 | String | - |
|
|
33
|
+
| disabled | 是否禁用 | Boolean | false |
|
|
34
|
+
| key | item 的唯一标志 | String | - |
|
|
35
|
+
| title | 设置收缩时展示的悬浮标题 | String | - |
|
|
36
|
+
|
|
37
|
+
### SubMenu
|
|
27
38
|
|
|
28
39
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
29
40
|
| -------- | --------------- | ------------ | ------ |
|
|
@@ -32,7 +43,7 @@
|
|
|
32
43
|
| key | item 的唯一标志 | String | - |
|
|
33
44
|
| title | 子菜单项值 | String,slots | - |
|
|
34
45
|
|
|
35
|
-
###
|
|
46
|
+
### MenuGroup
|
|
36
47
|
|
|
37
48
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
38
49
|
| ----- | -------- | ------------ | ------ |
|
package/components/menu/menu.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, provide, inject, onMounted } from "vue";
|
|
2
2
|
import { withInstall } from "../utils/vue";
|
|
3
|
-
|
|
3
|
+
import RecursiveMenu from "./recursiveMenu";
|
|
4
4
|
const Menu = defineComponent({
|
|
5
5
|
name: "Menu",
|
|
6
6
|
props: {
|
|
@@ -9,6 +9,7 @@ const Menu = defineComponent({
|
|
|
9
9
|
value: { type: Array, default: () => [] },
|
|
10
10
|
// selectedKeys: { type: Array, default: () => [] }, // for 3
|
|
11
11
|
accordion: Boolean,
|
|
12
|
+
items: Array,
|
|
12
13
|
inlineCollapsed: Boolean,
|
|
13
14
|
openKeys: { type: Array, default: () => [] },
|
|
14
15
|
},
|
|
@@ -116,7 +117,8 @@ const Menu = defineComponent({
|
|
|
116
117
|
provide("selectedKeysChange", selectedKeysChange);
|
|
117
118
|
|
|
118
119
|
return () => {
|
|
119
|
-
const preCls = dropdown ? "dropdown-menu" : "menu";
|
|
120
|
+
const preCls = dropdown ? "dropdown-menu k-scroll" : "menu";
|
|
121
|
+
const { items } = props;
|
|
120
122
|
const cls = [
|
|
121
123
|
`k-${preCls} k-${preCls}-${currentMode.value}`,
|
|
122
124
|
{
|
|
@@ -125,7 +127,11 @@ const Menu = defineComponent({
|
|
|
125
127
|
];
|
|
126
128
|
return (
|
|
127
129
|
<ul class={cls} theme-mode={props.theme}>
|
|
128
|
-
{
|
|
130
|
+
{items && items.length
|
|
131
|
+
? items.map((item) => {
|
|
132
|
+
return <RecursiveMenu item={item} key={item.key} />;
|
|
133
|
+
})
|
|
134
|
+
: slots.default?.()}
|
|
129
135
|
</ul>
|
|
130
136
|
);
|
|
131
137
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { getChildren } from "../utils/vnode";
|
|
3
|
-
import { withInstall } from
|
|
3
|
+
import { withInstall } from "../utils/vue";
|
|
4
4
|
import {
|
|
5
5
|
defineComponent,
|
|
6
6
|
ref,
|
|
@@ -53,8 +53,8 @@ const MenuItem = defineComponent({
|
|
|
53
53
|
style: {
|
|
54
54
|
paddingLeft:
|
|
55
55
|
(mode.value == "inline" || mode.value == "vertical") &&
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
keyPah.length &&
|
|
57
|
+
!ps.isPopup
|
|
58
58
|
? `${keyPah.length * 16 + 16}px`
|
|
59
59
|
: null,
|
|
60
60
|
},
|
|
@@ -83,7 +83,7 @@ const MenuItem = defineComponent({
|
|
|
83
83
|
if (disabled) return;
|
|
84
84
|
selectedKeysChange?.(key, true, keyPah);
|
|
85
85
|
},
|
|
86
|
-
}
|
|
86
|
+
},
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
// 没有子集的时候才展示
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import RecursiveSubMenu from "./recursiveMenu.jsx";
|
|
2
|
+
import SubMenu from "./submenu.jsx";
|
|
3
|
+
import MenuItem from "./menuitem.jsx";
|
|
4
|
+
import { defineComponent } from "vue";
|
|
5
|
+
const RecursiveMenu = defineComponent({
|
|
6
|
+
name: "RecursiveMenu",
|
|
7
|
+
props: {
|
|
8
|
+
item: Object,
|
|
9
|
+
isPopup: Boolean,
|
|
10
|
+
},
|
|
11
|
+
setup(props) {
|
|
12
|
+
return () => {
|
|
13
|
+
const { item } = props;
|
|
14
|
+
return item.children && item.children.length > 0 ? (
|
|
15
|
+
<SubMenu
|
|
16
|
+
key={item.key}
|
|
17
|
+
isPopup={props.isPopup}
|
|
18
|
+
title={item.title}
|
|
19
|
+
icon={item.icon}
|
|
20
|
+
disabled={item.disabled}
|
|
21
|
+
>
|
|
22
|
+
{item.children.map((child) => {
|
|
23
|
+
return <RecursiveSubMenu item={child} key={child.key} />;
|
|
24
|
+
})}
|
|
25
|
+
</SubMenu>
|
|
26
|
+
) : (
|
|
27
|
+
<MenuItem
|
|
28
|
+
key={item.key}
|
|
29
|
+
isPopup={props.isPopup}
|
|
30
|
+
icon={item.icon}
|
|
31
|
+
disabled={item.disabled}
|
|
32
|
+
>
|
|
33
|
+
{item.title}
|
|
34
|
+
</MenuItem>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default RecursiveMenu;
|