vue-devui 1.0.0-beta.9 → 1.0.0-rc.1
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/README.md +100 -72
- package/accordion/index.es.js +525 -39
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.es.js +34 -37
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/{time-axis → auto-complete}/index.d.ts +0 -0
- package/auto-complete/index.es.js +983 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/back-top/index.es.js +5 -3
- package/back-top/index.umd.js +1 -1
- package/badge/index.es.js +13 -19
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/index.es.js +2 -1
- package/button/index.es.js +296 -117
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +43 -57
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +5412 -784
- package/cascader/index.umd.js +27 -1
- package/cascader/style.css +1 -1
- package/checkbox/style.css +1 -1
- package/{toast → color-picker}/index.d.ts +0 -0
- package/color-picker/index.es.js +8196 -0
- package/color-picker/index.umd.js +27 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.es.js +42 -13
- package/comment/index.umd.js +1 -1
- package/comment/style.css +1 -1
- package/countdown/index.es.js +27 -17
- package/countdown/index.umd.js +1 -1
- package/countdown/style.css +1 -1
- package/date-picker/index.es.js +48 -66
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.es.js +135 -10
- package/dragdrop/index.umd.js +1 -1
- package/drawer/index.es.js +169 -223
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +463 -300
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +293 -5660
- package/editable-select/index.umd.js +1 -27
- package/editable-select/style.css +1 -1
- package/form/index.es.js +6210 -531
- package/form/index.umd.js +27 -1
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +112 -133
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/gantt/index.es.js +6 -18
- package/gantt/index.umd.js +1 -1
- package/gantt/style.css +1 -1
- package/grid/index.es.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +39 -56
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +35 -16
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +4 -5
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-icon/index.es.js +42 -41
- package/input-icon/index.umd.js +1 -1
- package/input-icon/style.css +1 -1
- package/input-number/index.es.js +46 -56
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/list/index.d.ts +7 -0
- package/list/index.es.js +39 -0
- package/list/index.umd.js +1 -0
- package/{toast → list}/package.json +1 -1
- package/list/style.css +1 -0
- package/loading/index.es.js +2 -2
- package/modal/index.es.js +304 -765
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.es.js +1 -675
- package/nav-sprite/index.umd.js +1 -1
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +284 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/CarouselItem.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/List.js +3 -0
- package/nuxt/components/ListItem.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/overlayEmits.js +3 -0
- package/nuxt/components/overlayProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.es.js +156 -205
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +12 -55
- package/pagination/index.es.js +11 -13
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +48 -35
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +5954 -189
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.es.js +8 -8
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.es.js +5405 -166
- package/quadrant-diagram/index.umd.js +27 -1
- package/radio/index.es.js +8 -14
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/read-tip/style.css +1 -1
- package/result/index.es.js +38 -52
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +10 -6
- package/search/index.es.js +5428 -200
- package/search/index.umd.js +27 -1
- package/search/style.css +1 -1
- package/select/index.es.js +43 -42
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +4 -6
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +5896 -39
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +19 -32
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps-guide/index.es.js +6 -3
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/table/index.es.js +753 -358
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +3 -4
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +4 -3
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -14
- package/tag-input/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.es.js +309 -123
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/timeline/index.d.ts +7 -0
- package/{time-axis → timeline}/index.es.js +65 -77
- package/timeline/index.umd.js +1 -0
- package/{time-axis → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5805 -141
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +6521 -630
- package/transfer/index.umd.js +27 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +5781 -193
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/tree-select/index.es.js +138 -39
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +450 -2669
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14414 -14096
- package/vue-devui.umd.js +19 -19
- package/time-axis/index.umd.js +0 -1
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
package/accordion/index.es.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,7 +16,9 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
17
|
-
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, isVNode, createTextVNode, provide, onMounted, watch } from "vue";
|
|
21
|
+
import { useRoute } from "vue-router";
|
|
18
22
|
const accordionProps = {
|
|
19
23
|
data: {
|
|
20
24
|
type: Array,
|
|
@@ -26,8 +30,8 @@ const accordionProps = {
|
|
|
26
30
|
disabledKey: { type: String, default: "disabled" },
|
|
27
31
|
activeKey: { type: String, default: "active" },
|
|
28
32
|
openKey: { type: String, default: "open" },
|
|
29
|
-
menuItemTemplate: { type:
|
|
30
|
-
itemTemplate: { type:
|
|
33
|
+
menuItemTemplate: { type: Boolean, default: true },
|
|
34
|
+
itemTemplate: { type: Boolean, default: true },
|
|
31
35
|
menuToggle: {
|
|
32
36
|
type: Function,
|
|
33
37
|
default: null
|
|
@@ -43,9 +47,9 @@ const accordionProps = {
|
|
|
43
47
|
restrictOneOpen: { type: Boolean, default: false },
|
|
44
48
|
autoOpenActiveMenu: { type: Boolean, default: false },
|
|
45
49
|
showNoContent: { type: Boolean, default: true },
|
|
46
|
-
noContentTemplate: { type:
|
|
47
|
-
loadingTemplate: { type:
|
|
48
|
-
innerListTemplate: { type:
|
|
50
|
+
noContentTemplate: { type: Boolean, default: true },
|
|
51
|
+
loadingTemplate: { type: Boolean, default: true },
|
|
52
|
+
innerListTemplate: { type: Boolean, default: true },
|
|
49
53
|
linkType: {
|
|
50
54
|
type: String,
|
|
51
55
|
default: ""
|
|
@@ -59,8 +63,43 @@ const accordionProps = {
|
|
|
59
63
|
default: "normal"
|
|
60
64
|
}
|
|
61
65
|
};
|
|
66
|
+
const OpenIcon = () => {
|
|
67
|
+
return createVNode("svg", {
|
|
68
|
+
"width": "1em",
|
|
69
|
+
"height": "1em",
|
|
70
|
+
"viewBox": "0 0 16 16",
|
|
71
|
+
"version": "1.1",
|
|
72
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
73
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
74
|
+
}, [createVNode("g", {
|
|
75
|
+
"stroke": "none",
|
|
76
|
+
"stroke-width": "1",
|
|
77
|
+
"fill": "none",
|
|
78
|
+
"fill-rule": "evenodd"
|
|
79
|
+
}, [createVNode("path", {
|
|
80
|
+
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
81
|
+
"fill-rule": "nonzero"
|
|
82
|
+
}, null)])]);
|
|
83
|
+
};
|
|
84
|
+
const getRootSlots = () => {
|
|
85
|
+
const rootComponentName = "DAccordion";
|
|
86
|
+
const getRootComponent = (component) => {
|
|
87
|
+
if (component && component.type.name === rootComponentName) {
|
|
88
|
+
return component;
|
|
89
|
+
}
|
|
90
|
+
if (component && component.parent) {
|
|
91
|
+
const parent = component.parent;
|
|
92
|
+
return getRootComponent(parent);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const rootComponent = getRootComponent(getCurrentInstance());
|
|
96
|
+
return rootComponent == null ? void 0 : rootComponent.slots;
|
|
97
|
+
};
|
|
62
98
|
var DAccordionMenu = defineComponent({
|
|
63
99
|
name: "DAccordionMenu",
|
|
100
|
+
components: {
|
|
101
|
+
OpenIcon
|
|
102
|
+
},
|
|
64
103
|
props: __spreadValues({
|
|
65
104
|
item: Object,
|
|
66
105
|
deepth: {
|
|
@@ -75,36 +114,370 @@ var DAccordionMenu = defineComponent({
|
|
|
75
114
|
setup(props) {
|
|
76
115
|
const {
|
|
77
116
|
item,
|
|
78
|
-
deepth
|
|
117
|
+
deepth,
|
|
118
|
+
parent,
|
|
119
|
+
openKey,
|
|
120
|
+
activeKey,
|
|
121
|
+
autoOpenActiveMenu,
|
|
122
|
+
disabledKey,
|
|
123
|
+
childrenKey,
|
|
124
|
+
titleKey,
|
|
125
|
+
menuItemTemplate
|
|
79
126
|
} = toRefs(props);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
127
|
+
const rootSlots = getRootSlots();
|
|
128
|
+
const accordionCtx = inject("accordionContext");
|
|
129
|
+
const parentValue = parent.value;
|
|
130
|
+
const deepValue = deepth.value;
|
|
131
|
+
const toggle = (itemEvent) => {
|
|
132
|
+
accordionCtx.menuToggleFn(itemEvent);
|
|
133
|
+
};
|
|
134
|
+
const hasActiveChildren = (item2) => {
|
|
135
|
+
if (item2[activeKey.value] === true) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
if (item2[childrenKey.value]) {
|
|
139
|
+
return hasChildActive(item2[childrenKey.value]);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const hasChildActive = (arr) => {
|
|
143
|
+
let flag = false;
|
|
144
|
+
if (!arr.length) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
for (let i = 0; i < arr.length; i++) {
|
|
148
|
+
if (arr[i][activeKey.value] === true) {
|
|
149
|
+
flag = true;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
if (arr[i][childrenKey.value]) {
|
|
153
|
+
flag = hasChildActive(arr[i][childrenKey.value]);
|
|
154
|
+
if (flag) {
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return flag;
|
|
160
|
+
};
|
|
83
161
|
const keyOpen = computed(() => {
|
|
84
|
-
return item
|
|
162
|
+
return item.value && item.value[openKey.value];
|
|
163
|
+
});
|
|
164
|
+
const disabled = computed(() => {
|
|
165
|
+
return item.value && item.value[disabledKey.value];
|
|
166
|
+
});
|
|
167
|
+
const title = computed(() => {
|
|
168
|
+
return item.value && item.value[titleKey.value];
|
|
169
|
+
});
|
|
170
|
+
const children = computed(() => {
|
|
171
|
+
return item.value && item.value[childrenKey.value];
|
|
85
172
|
});
|
|
86
173
|
const childActived = computed(() => {
|
|
174
|
+
return hasActiveChildren(item.value);
|
|
175
|
+
});
|
|
176
|
+
const open = computed(() => {
|
|
177
|
+
return keyOpen.value === void 0 && autoOpenActiveMenu.value ? childActived.value : keyOpen.value;
|
|
87
178
|
});
|
|
88
179
|
return () => {
|
|
180
|
+
var _a;
|
|
89
181
|
return createVNode(Fragment, null, [createVNode("div", {
|
|
90
|
-
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis",
|
|
91
|
-
"title":
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"
|
|
96
|
-
|
|
182
|
+
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", open.value && "open", childActived.value && "active", disabled.value && "disabled"],
|
|
183
|
+
"title": title.value,
|
|
184
|
+
"style": {
|
|
185
|
+
textIndent: deepValue * 20 + "px"
|
|
186
|
+
},
|
|
187
|
+
"onClick": (e) => !disabled.value && toggle({
|
|
188
|
+
item: item.value,
|
|
189
|
+
open: !open.value,
|
|
190
|
+
parent: parentValue,
|
|
191
|
+
event: e
|
|
192
|
+
})
|
|
193
|
+
}, [createVNode("div", {
|
|
194
|
+
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
195
|
+
"style": {
|
|
196
|
+
left: deepValue * 20 + 10 + "px"
|
|
197
|
+
}
|
|
198
|
+
}, null), (!rootSlots.menuItemTemplate || menuItemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.menuItemTemplate && menuItemTemplate.value !== false && ((_a = rootSlots.menuItemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
199
|
+
parent: parentValue,
|
|
200
|
+
deepth: deepValue,
|
|
201
|
+
item: item.value
|
|
202
|
+
})), createVNode("span", {
|
|
203
|
+
"class": "devui-accordion-open-icon"
|
|
204
|
+
}, [createVNode(OpenIcon, null, null)])]), createVNode("div", {
|
|
205
|
+
"class": [!open.value && "devui-accordion-menu-hidden", "devui-accordion-submenu", "devui-accordion-show-animate"]
|
|
206
|
+
}, [createVNode(AccordionList, mergeProps(props, {
|
|
207
|
+
"deepth": deepValue + 1,
|
|
208
|
+
"data": children.value || [],
|
|
97
209
|
"parent": item.value
|
|
98
|
-
}, null)]);
|
|
210
|
+
}), null)])]);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
var DAccordionItem = defineComponent({
|
|
215
|
+
name: "DAccordionItem",
|
|
216
|
+
props: __spreadValues({
|
|
217
|
+
item: Object,
|
|
218
|
+
deepth: {
|
|
219
|
+
type: Number,
|
|
220
|
+
default: 0
|
|
221
|
+
},
|
|
222
|
+
parent: {
|
|
223
|
+
type: Object,
|
|
224
|
+
default: null
|
|
225
|
+
}
|
|
226
|
+
}, accordionProps),
|
|
227
|
+
setup(props) {
|
|
228
|
+
const {
|
|
229
|
+
item,
|
|
230
|
+
deepth,
|
|
231
|
+
parent,
|
|
232
|
+
titleKey,
|
|
233
|
+
activeKey,
|
|
234
|
+
disabledKey,
|
|
235
|
+
itemTemplate
|
|
236
|
+
} = toRefs(props);
|
|
237
|
+
const rootSlots = getRootSlots();
|
|
238
|
+
const accordionCtx = inject("accordionContext");
|
|
239
|
+
const parentValue = parent.value;
|
|
240
|
+
const deepValue = deepth.value;
|
|
241
|
+
const disabled = computed(() => {
|
|
242
|
+
return item.value && item.value[disabledKey.value];
|
|
243
|
+
});
|
|
244
|
+
const title = computed(() => {
|
|
245
|
+
return item.value && item.value[titleKey.value];
|
|
246
|
+
});
|
|
247
|
+
const active = computed(() => {
|
|
248
|
+
return item.value && item.value[activeKey.value];
|
|
249
|
+
});
|
|
250
|
+
const childActived = computed(() => {
|
|
251
|
+
return active.value;
|
|
252
|
+
});
|
|
253
|
+
const itemClick = (itemEvent) => {
|
|
254
|
+
if (item.value && !disabled.value) {
|
|
255
|
+
accordionCtx.itemClickFn(itemEvent);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
return () => {
|
|
259
|
+
var _a;
|
|
260
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
261
|
+
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", childActived.value && "active", disabled.value && "disabled"],
|
|
262
|
+
"title": title.value,
|
|
263
|
+
"style": {
|
|
264
|
+
textIndent: deepValue * 20 + "px"
|
|
265
|
+
},
|
|
266
|
+
"onClick": (e) => itemClick({
|
|
267
|
+
item: item.value,
|
|
268
|
+
parent: parentValue,
|
|
269
|
+
event: e
|
|
270
|
+
})
|
|
271
|
+
}, [createVNode("div", {
|
|
272
|
+
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
273
|
+
"style": {
|
|
274
|
+
left: deepValue * 20 + 10 + "px"
|
|
275
|
+
}
|
|
276
|
+
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
277
|
+
parent: parentValue,
|
|
278
|
+
deepth: deepValue,
|
|
279
|
+
item: item.value
|
|
280
|
+
}))])]);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
var DAccordionItemHreflink = defineComponent({
|
|
285
|
+
name: "DAccordionItemHreflink",
|
|
286
|
+
component: {
|
|
287
|
+
DAccordionItem
|
|
288
|
+
},
|
|
289
|
+
props: __spreadValues({
|
|
290
|
+
item: Object,
|
|
291
|
+
deepth: {
|
|
292
|
+
type: Number,
|
|
293
|
+
default: 0
|
|
294
|
+
},
|
|
295
|
+
parent: {
|
|
296
|
+
type: Object,
|
|
297
|
+
default: null
|
|
298
|
+
}
|
|
299
|
+
}, accordionProps),
|
|
300
|
+
setup(props) {
|
|
301
|
+
const {
|
|
302
|
+
item,
|
|
303
|
+
deepth,
|
|
304
|
+
parent,
|
|
305
|
+
titleKey,
|
|
306
|
+
linkKey,
|
|
307
|
+
linkTargetKey,
|
|
308
|
+
linkDefaultTarget,
|
|
309
|
+
disabledKey,
|
|
310
|
+
itemTemplate
|
|
311
|
+
} = toRefs(props);
|
|
312
|
+
const rootSlots = getRootSlots();
|
|
313
|
+
const accordionCtx = inject("accordionContext");
|
|
314
|
+
const title = computed(() => {
|
|
315
|
+
return item.value && item.value[titleKey.value];
|
|
316
|
+
});
|
|
317
|
+
const link = computed(() => {
|
|
318
|
+
return item.value && item.value[linkKey.value];
|
|
319
|
+
});
|
|
320
|
+
const target = computed(() => {
|
|
321
|
+
return item.value && (item.value[linkTargetKey.value] || linkDefaultTarget.value);
|
|
322
|
+
});
|
|
323
|
+
const disabled = computed(() => {
|
|
324
|
+
return item.value && item.value[disabledKey.value];
|
|
325
|
+
});
|
|
326
|
+
const parentValue = parent.value;
|
|
327
|
+
const deepValue = deepth.value;
|
|
328
|
+
const linkItemClickFn = (itemEvent) => {
|
|
329
|
+
if (item.value && !disabled.value) {
|
|
330
|
+
accordionCtx.itemClickFn(itemEvent);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
const renderContent = () => {
|
|
334
|
+
var _a;
|
|
335
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
336
|
+
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
337
|
+
"style": {
|
|
338
|
+
left: deepValue * 20 + 10 + "px"
|
|
339
|
+
}
|
|
340
|
+
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
341
|
+
parent: parentValue,
|
|
342
|
+
deepth: deepValue,
|
|
343
|
+
item: item.value
|
|
344
|
+
}))]);
|
|
345
|
+
};
|
|
346
|
+
return () => {
|
|
347
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
348
|
+
"class": ["devui-accordion-item-title", disabled.value && "disabled"],
|
|
349
|
+
"style": {
|
|
350
|
+
textIndent: deepValue * 20 + "px"
|
|
351
|
+
}
|
|
352
|
+
}, [!disabled.value && createVNode("a", {
|
|
353
|
+
"href": link.value,
|
|
354
|
+
"target": target.value,
|
|
355
|
+
"class": "devui-over-flow-ellipsis",
|
|
356
|
+
"title": title.value,
|
|
357
|
+
"onClick": (e) => linkItemClickFn({
|
|
358
|
+
item: item.value,
|
|
359
|
+
parent: parentValue,
|
|
360
|
+
event: e
|
|
361
|
+
})
|
|
362
|
+
}, [renderContent()]), disabled.value && createVNode("a", {
|
|
363
|
+
"class": "devui-over-flow-ellipsis",
|
|
364
|
+
"title": title.value
|
|
365
|
+
}, [renderContent()])])]);
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
function _isSlot(s) {
|
|
370
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
371
|
+
}
|
|
372
|
+
var DAccordionItemRouterlink = defineComponent({
|
|
373
|
+
name: "DAccordionItemRouterlink",
|
|
374
|
+
component: {
|
|
375
|
+
DAccordionItem
|
|
376
|
+
},
|
|
377
|
+
props: __spreadValues({
|
|
378
|
+
item: Object,
|
|
379
|
+
deepth: {
|
|
380
|
+
type: Number,
|
|
381
|
+
default: 0
|
|
382
|
+
},
|
|
383
|
+
parent: {
|
|
384
|
+
type: Object,
|
|
385
|
+
default: null
|
|
386
|
+
}
|
|
387
|
+
}, accordionProps),
|
|
388
|
+
setup(props) {
|
|
389
|
+
const {
|
|
390
|
+
item,
|
|
391
|
+
deepth,
|
|
392
|
+
parent,
|
|
393
|
+
titleKey,
|
|
394
|
+
linkKey,
|
|
395
|
+
linkDefaultTarget,
|
|
396
|
+
disabledKey,
|
|
397
|
+
itemTemplate
|
|
398
|
+
} = toRefs(props);
|
|
399
|
+
const route = useRoute();
|
|
400
|
+
const rootSlots = getRootSlots();
|
|
401
|
+
const accordionCtx = inject("accordionContext");
|
|
402
|
+
console.log(useRoute());
|
|
403
|
+
const title = computed(() => {
|
|
404
|
+
return item.value && item.value[titleKey.value];
|
|
405
|
+
});
|
|
406
|
+
const link = computed(() => {
|
|
407
|
+
return item.value && item.value[linkKey.value];
|
|
408
|
+
});
|
|
409
|
+
const isUsedVueRouter = computed(() => route !== void 0);
|
|
410
|
+
const routerLinkActive = computed(() => {
|
|
411
|
+
return route === link.value;
|
|
412
|
+
});
|
|
413
|
+
const disabled = computed(() => {
|
|
414
|
+
return item.value && item.value[disabledKey.value];
|
|
415
|
+
});
|
|
416
|
+
const parentValue = parent.value;
|
|
417
|
+
const deepValue = deepth.value;
|
|
418
|
+
const linkItemClickFn = (itemEvent) => {
|
|
419
|
+
if (item.value && !disabled.value) {
|
|
420
|
+
accordionCtx.itemClickFn(itemEvent);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
const renderContent = () => {
|
|
424
|
+
var _a;
|
|
425
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
426
|
+
"class": ["devui-accordion-splitter", deepValue === 0 && "devui-parent-list"],
|
|
427
|
+
"style": {
|
|
428
|
+
left: deepValue * 20 + 10 + "px"
|
|
429
|
+
}
|
|
430
|
+
}, null), (!rootSlots.itemTemplate || itemTemplate.value === false) && createVNode(Fragment, null, [title.value]), rootSlots.itemTemplate && itemTemplate.value !== false && ((_a = rootSlots.itemTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
431
|
+
parent: parentValue,
|
|
432
|
+
deepth: deepValue,
|
|
433
|
+
item: item.value
|
|
434
|
+
}))]);
|
|
435
|
+
};
|
|
436
|
+
return () => {
|
|
437
|
+
let _slot;
|
|
438
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
439
|
+
"class": ["devui-accordion-item-title", disabled.value && "disabled"],
|
|
440
|
+
"style": {
|
|
441
|
+
textIndent: deepValue * 20 + "px"
|
|
442
|
+
}
|
|
443
|
+
}, [!disabled.value && createVNode(Fragment, null, [isUsedVueRouter.value && createVNode(resolveComponent("router-link"), {
|
|
444
|
+
"to": link.value,
|
|
445
|
+
"class": ["devui-over-flow-ellipsis", routerLinkActive.value && ".devui-router-active"],
|
|
446
|
+
"custom": true,
|
|
447
|
+
"title": title.value,
|
|
448
|
+
"onClick": (e) => linkItemClickFn({
|
|
449
|
+
item: item.value,
|
|
450
|
+
parent: parentValue,
|
|
451
|
+
event: e
|
|
452
|
+
})
|
|
453
|
+
}, _isSlot(_slot = renderContent()) ? _slot : {
|
|
454
|
+
default: () => [_slot]
|
|
455
|
+
}), !isUsedVueRouter.value && createVNode("a", {
|
|
456
|
+
"href": link.value,
|
|
457
|
+
"target": linkDefaultTarget.value,
|
|
458
|
+
"class": "devui-over-flow-ellipsis",
|
|
459
|
+
"title": title.value,
|
|
460
|
+
"onClick": (e) => linkItemClickFn({
|
|
461
|
+
item: item.value,
|
|
462
|
+
parent: parentValue,
|
|
463
|
+
event: e
|
|
464
|
+
})
|
|
465
|
+
}, [renderContent()])]), disabled.value && createVNode("a", {
|
|
466
|
+
"class": "devui-over-flow-ellipsis",
|
|
467
|
+
"title": title.value
|
|
468
|
+
}, [renderContent()])])]);
|
|
99
469
|
};
|
|
100
470
|
}
|
|
101
471
|
});
|
|
102
472
|
var AccordionList = defineComponent({
|
|
103
473
|
name: "DAccordionList",
|
|
104
|
-
inheritAttrs: false,
|
|
105
474
|
components: {
|
|
106
|
-
DAccordionMenu
|
|
475
|
+
DAccordionMenu,
|
|
476
|
+
DAccordionItem,
|
|
477
|
+
DAccordionItemHreflink,
|
|
478
|
+
DAccordionItemRouterlink
|
|
107
479
|
},
|
|
480
|
+
inheritAttrs: false,
|
|
108
481
|
props: __spreadValues({
|
|
109
482
|
data: {
|
|
110
483
|
type: Array,
|
|
@@ -121,27 +494,105 @@ var AccordionList = defineComponent({
|
|
|
121
494
|
innerListTemplate: Boolean
|
|
122
495
|
}, accordionProps),
|
|
123
496
|
setup(props, {
|
|
124
|
-
attrs
|
|
125
|
-
slots
|
|
497
|
+
attrs
|
|
126
498
|
}) {
|
|
127
499
|
const {
|
|
128
500
|
childrenKey,
|
|
129
|
-
|
|
130
|
-
|
|
501
|
+
deepth,
|
|
502
|
+
parent,
|
|
503
|
+
data,
|
|
504
|
+
linkType,
|
|
505
|
+
showNoContent,
|
|
506
|
+
loadingKey,
|
|
507
|
+
titleKey,
|
|
508
|
+
linkTypeKey,
|
|
509
|
+
loadingTemplate,
|
|
510
|
+
noContentTemplate,
|
|
511
|
+
innerListTemplate
|
|
131
512
|
} = toRefs(props);
|
|
513
|
+
const parentValue = parent.value;
|
|
514
|
+
const deepValue = deepth.value;
|
|
515
|
+
const rootSlots = getRootSlots();
|
|
516
|
+
const accordionCtx = inject("accordionContext");
|
|
517
|
+
const loading = computed(() => {
|
|
518
|
+
return parentValue && parentValue[loadingKey.value];
|
|
519
|
+
});
|
|
520
|
+
const noContent = computed(() => {
|
|
521
|
+
const dataValue = data.value;
|
|
522
|
+
return dataValue === void 0 || dataValue === null || dataValue.length === 0;
|
|
523
|
+
});
|
|
132
524
|
return () => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
525
|
+
var _a, _b, _c;
|
|
526
|
+
return createVNode(Fragment, null, [(!rootSlots.innerListTemplate || deepth.value === 0 || innerListTemplate.value === false) && createVNode("ul", mergeProps({
|
|
527
|
+
"class": ["devui-accordion-list"]
|
|
528
|
+
}, attrs), [data.value.map((item) => {
|
|
136
529
|
return createVNode("li", {
|
|
137
530
|
"class": "devui-accordion-item",
|
|
138
|
-
"key": item.
|
|
139
|
-
}, [childrenKey !== void 0 && createVNode(
|
|
531
|
+
"key": item[titleKey.value]
|
|
532
|
+
}, [item[childrenKey.value] !== void 0 && createVNode("div", {
|
|
533
|
+
"class": "devui-accordion-menu-item"
|
|
534
|
+
}, [createVNode(resolveComponent("d-accordion-menu"), mergeProps(props, {
|
|
535
|
+
"item": item,
|
|
536
|
+
"deepth": deepValue,
|
|
537
|
+
"parent": parentValue
|
|
538
|
+
}), null)]), item[childrenKey.value] === void 0 && createVNode(Fragment, null, [(!linkType.value || linkType.value === "") && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
|
|
539
|
+
"item": item,
|
|
540
|
+
"deepth": deepValue,
|
|
541
|
+
"parent": parentValue
|
|
542
|
+
}), null), linkType.value === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
|
|
543
|
+
"item": item,
|
|
544
|
+
"deepth": deepValue,
|
|
545
|
+
"parent": parentValue
|
|
546
|
+
}), null), linkType.value === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
|
|
140
547
|
"item": item,
|
|
141
|
-
"deepth":
|
|
142
|
-
"parent":
|
|
143
|
-
},
|
|
144
|
-
|
|
548
|
+
"deepth": deepValue,
|
|
549
|
+
"parent": parentValue
|
|
550
|
+
}), null), linkType.value === "dependOnLinkTypeKey" && createVNode(Fragment, null, [item[linkTypeKey.value] === "routerLink" && createVNode(resolveComponent("d-accordion-item-routerlink"), mergeProps(props, {
|
|
551
|
+
"item": item,
|
|
552
|
+
"deepth": deepValue,
|
|
553
|
+
"parent": parentValue
|
|
554
|
+
}), null), item[linkTypeKey.value] === "hrefLink" && createVNode(resolveComponent("d-accordion-item-hreflink"), mergeProps(props, {
|
|
555
|
+
"item": item,
|
|
556
|
+
"deepth": deepValue,
|
|
557
|
+
"parent": parentValue
|
|
558
|
+
}), null), item[linkTypeKey.value] !== "routerLink" && item[linkTypeKey.value] !== "hrefLink" && createVNode(resolveComponent("d-accordion-item"), mergeProps(props, {
|
|
559
|
+
"item": item,
|
|
560
|
+
"deepth": deepValue,
|
|
561
|
+
"parent": parentValue
|
|
562
|
+
}), null)])])]);
|
|
563
|
+
})]), rootSlots.innerListTemplate && innerListTemplate.value !== false && deepValue !== 0 && ((_a = rootSlots.innerListTemplate) == null ? void 0 : _a.call(rootSlots, {
|
|
564
|
+
item: parentValue,
|
|
565
|
+
deepth: deepValue,
|
|
566
|
+
itemClickFn: accordionCtx.itemClickFn,
|
|
567
|
+
menuToggleFn: accordionCtx.menuToggleFn
|
|
568
|
+
})), (!rootSlots.innerListTemplate || innerListTemplate.value === false) && (loading.value || noContent.value && showNoContent.value) && createVNode("ul", mergeProps({
|
|
569
|
+
"class": ["devui-accordion-list"]
|
|
570
|
+
}, attrs), [
|
|
571
|
+
loading.value && (!rootSlots.loadingTemplate || loadingTemplate.value === false) && createVNode("li", {
|
|
572
|
+
"class": "devui-accordion-item"
|
|
573
|
+
}, [createVNode("div", {
|
|
574
|
+
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis"],
|
|
575
|
+
"style": {
|
|
576
|
+
textIndent: deepValue * 20 + "px"
|
|
577
|
+
}
|
|
578
|
+
}, [createTextVNode("\u52A0\u8F7D\u4E2D...")])]),
|
|
579
|
+
loading.value && rootSlots.loadingTemplate && loadingTemplate.value !== false && ((_b = rootSlots.loadingTemplate) == null ? void 0 : _b.call(rootSlots, {
|
|
580
|
+
item: parentValue,
|
|
581
|
+
deepth: deepValue
|
|
582
|
+
})),
|
|
583
|
+
showNoContent.value && !loading.value && noContent.value && (!rootSlots.noContentTemplate || noContentTemplate.value === false) && createVNode("li", {
|
|
584
|
+
"class": "devui-accordion-item"
|
|
585
|
+
}, [createVNode("div", {
|
|
586
|
+
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis disabled"],
|
|
587
|
+
"style": {
|
|
588
|
+
textIndent: deepValue * 20 + "px"
|
|
589
|
+
}
|
|
590
|
+
}, [createTextVNode("\u6CA1\u6709\u6570\u636E")])]),
|
|
591
|
+
showNoContent.value && !loading.value && noContent.value && rootSlots.noContentTemplate && noContentTemplate.value !== false && ((_c = rootSlots.noContentTemplate) == null ? void 0 : _c.call(rootSlots, {
|
|
592
|
+
item: parentValue,
|
|
593
|
+
deepth: deepValue
|
|
594
|
+
}))
|
|
595
|
+
])]);
|
|
145
596
|
};
|
|
146
597
|
}
|
|
147
598
|
});
|
|
@@ -198,28 +649,63 @@ var Accordion = defineComponent({
|
|
|
198
649
|
clickActiveItem = item;
|
|
199
650
|
emit("activeItemChange", clickActiveItem);
|
|
200
651
|
};
|
|
652
|
+
const openMenuFn = (item, open) => {
|
|
653
|
+
if (open && restrictOneOpen.value) {
|
|
654
|
+
data.value.forEach((itemtemp) => {
|
|
655
|
+
itemtemp[openKey.value] = false;
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
item[openKey.value] = open;
|
|
659
|
+
};
|
|
660
|
+
const itemClickFn = (itemEvent) => {
|
|
661
|
+
const prevActiveItem = clickActiveItem;
|
|
662
|
+
activeItemFn(itemEvent.item);
|
|
663
|
+
emit("itemClick", __spreadProps(__spreadValues({}, itemEvent), {
|
|
664
|
+
prevActiveItem
|
|
665
|
+
}));
|
|
666
|
+
};
|
|
667
|
+
const linkItemClickFn = (itemEvent) => {
|
|
668
|
+
const prevActiveItem = clickActiveItem;
|
|
669
|
+
clickActiveItem = itemEvent.item;
|
|
670
|
+
emit("linkItemClick", __spreadProps(__spreadValues({}, itemEvent), {
|
|
671
|
+
prevActiveItem
|
|
672
|
+
}));
|
|
673
|
+
};
|
|
674
|
+
const menuToggleFn = (menuEvent) => {
|
|
675
|
+
openMenuFn(menuEvent.item, menuEvent.open);
|
|
676
|
+
emit("menuToggle", menuEvent);
|
|
677
|
+
};
|
|
201
678
|
const cleanOpenData = () => {
|
|
202
679
|
flatten(data.value, childrenKey.value, true, false).forEach((item) => item[openKey.value] = void 0);
|
|
203
680
|
};
|
|
681
|
+
provide("accordionContext", {
|
|
682
|
+
itemClickFn,
|
|
683
|
+
linkItemClickFn,
|
|
684
|
+
menuToggleFn
|
|
685
|
+
});
|
|
204
686
|
onMounted(() => {
|
|
205
687
|
if (data.value) {
|
|
206
688
|
initActiveItem();
|
|
207
689
|
}
|
|
208
690
|
});
|
|
209
691
|
watch(() => autoOpenActiveMenu.value, (current, preV) => {
|
|
210
|
-
console.log("cur, new", current, preV);
|
|
211
692
|
if (current && preV === false) {
|
|
212
693
|
cleanOpenData();
|
|
213
694
|
}
|
|
214
695
|
});
|
|
696
|
+
watch(data.value, (current, preV) => {
|
|
697
|
+
initActiveItem();
|
|
698
|
+
}, {
|
|
699
|
+
deep: true
|
|
700
|
+
});
|
|
215
701
|
return () => {
|
|
216
702
|
return createVNode("div", {
|
|
217
|
-
"class":
|
|
218
|
-
}, [createVNode(AccordionList, mergeProps({
|
|
219
|
-
"data": data,
|
|
703
|
+
"class": ["devui-accordion-menu", "devui-scrollbar", "devui-accordion-show-animate", accordionType.value === "normal" && "devui-accordion-menu-normal"]
|
|
704
|
+
}, [createVNode(AccordionList, mergeProps(props, {
|
|
705
|
+
"data": data.value,
|
|
220
706
|
"deepth": 0,
|
|
221
707
|
"parent": null
|
|
222
|
-
}
|
|
708
|
+
}), null)]);
|
|
223
709
|
};
|
|
224
710
|
}
|
|
225
711
|
});
|