@das-fed/upf-web-components 6.4.0-dev.185 → 6.4.0-dev.187
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 +77 -320
- package/{ar-DWNjvLuE.js → ar-BV73BvHi.js} +1 -1
- package/{ar_EG-BnghxIoc.js → ar_EG-DSKHRo2z.js} +1 -1
- package/{de-NVZg2xno.js → de-BN1DkK_l.js} +1 -1
- package/{de_DE-C33GdCGl.js → de_DE-BknYN0OA.js} +1 -1
- package/{en_US-ByBhWry7.js → en_US-563j8kPU.js} +1 -1
- package/{es-Dz8mz88B.js → es-CE4znIWU.js} +1 -1
- package/{es_ES-DetwwTch.js → es_ES-uhexePX4.js} +1 -1
- package/{fr-BV4Yu4-4.js → fr-BftG4rt6.js} +1 -1
- package/{fr_FR-DqYGfX17.js → fr_FR-JVBygMqz.js} +1 -1
- package/{index-aLxDVoov.js → index-B1TARyz0.js} +1 -1
- package/{index-D-zcnVkg.js → index-BAa8INTt.js} +1 -1
- package/{index-C64D0Adc.js → index-BBMVWNuN.js} +1 -1
- package/{index-DIqztBOg.js → index-BEDGWJhy.js} +1 -1
- package/{index-BF54_Ooo.js → index-BF4qhqCu.js} +1 -1
- package/{index-ot2zLuO0.js → index-BGACXgei.js} +1 -1
- package/{index-B7yix1Y4.js → index-BHAKL_Uz.js} +1 -1
- package/{index-Z1gBVPAC.js → index-BJA9Pr8N.js} +1 -1
- package/{index-Tx-vSI8S.js → index-BQf2PYFs.js} +47264 -47241
- package/{index-CikODfn5.js → index-Bb8Oddie.js} +1 -1
- package/{index-CKwNUmwz.js → index-BdCtEf5A.js} +1 -1
- package/{index-IGO0PeyP.js → index-BqjFIjXh.js} +1 -1
- package/{index-CIgAXhFB.js → index-BrBTXqN6.js} +1 -1
- package/{index-DEf3Qmpf.js → index-C1IU775o.js} +1 -1
- package/{index-DkCZzZi9.js → index-C5q2axPY.js} +1 -1
- package/{index-DScVxUZ2.js → index-C6RbtI_X.js} +1 -1
- package/{index-CaxAE40y.js → index-C8Xoa-FF.js} +1 -1
- package/{index-ubaKCRN2.js → index-CDVM6C-H.js} +1 -1
- package/{index-Db5jR7A7.js → index-CGl19MPH.js} +1 -1
- package/{index-Cnbb0vRq.js → index-CIXd5-Nl.js} +1 -1
- package/{index-D1pfZ4Br.js → index-CPymUghy.js} +1 -1
- package/{index-CGZ-UVji.js → index-CQqFEekk.js} +1 -1
- package/{index-BamZraMf.js → index-CSHIyqSY.js} +1 -1
- package/{index-7ztCnit7.js → index-CWGxD-JP.js} +1 -1
- package/{index-Bths-fQc.js → index-CWsMucAK.js} +1 -1
- package/{index-DmtIolPL.js → index-CX4HKHtR.js} +1 -1
- package/{index-CkQkpPMr.js → index-CXTWOQ8q.js} +1 -1
- package/{index-C8Y36PoT.js → index-CY5JH6UH.js} +1 -1
- package/{index-z0EJNq3E.js → index-CdOnhvkR.js} +1 -1
- package/{index-B8JvLy8A.js → index-CgZWkgoM.js} +1 -1
- package/{index-CnJB-y-S.js → index-CzlkANr9.js} +48 -48
- package/{index-Dpfpwg0B.js → index-D1N8bUDG.js} +1 -1
- package/{index-DEvDBR5N.js → index-D8hoGH_8.js} +1 -1
- package/{index-C8s8yoOh.js → index-DAFCnR4M.js} +1 -1
- package/{index-C27obJTn.js → index-DEcE15GA.js} +1 -1
- package/{index-X4yGyNE7.js → index-DLBA_WCw.js} +1 -1
- package/{index-Cmr9IXnX.js → index-DN_SAMNO.js} +1 -1
- package/{index-B_FRgJ5G.js → index-DQ7UGn-i.js} +1 -1
- package/{index-BRUAWfbP.js → index-DQD-ROFe.js} +1 -1
- package/{index-BvWadIZN.js → index-DTWwCKrH.js} +1 -1
- package/{index-BaRE_Aqx.js → index-De_0PwaT.js} +1 -1
- package/{index-HyOvX-v2.js → index-DmjCSuXn.js} +1 -1
- package/{index-Bwnz4cKI.js → index-Dqt8mdnh.js} +1 -1
- package/{index-5LQEzLgM.js → index-KL5cOipe.js} +1 -1
- package/{index-DcKGpf5o.js → index-N0_W1YmQ.js} +1 -1
- package/{index-CNW8xQht.js → index-OlW5e9C3.js} +1 -1
- package/{index-BOq7jcuv.js → index-UbWiKSCS.js} +1 -1
- package/{index-Uqw43tF2.js → index-VgmhD-UI.js} +1 -1
- package/{index-nhcT_iUM.js → index-X8iBhKxx.js} +1 -1
- package/{index-BuZi-itN.js → index-hW9xBvQk.js} +1 -1
- package/index.js +2 -2
- package/{it-xYMeWSfU.js → it-CPR7jlYk.js} +1 -1
- package/{it_IT-Bo_JYDk6.js → it_IT-KLayhegD.js} +1 -1
- package/{nl-BI3YbZpT.js → nl-BACGWP_P.js} +1 -1
- package/{nl_NL-C1dKt4WH.js → nl_NL-BymgIT8Q.js} +1 -1
- package/package.json +6 -6
- package/{pt-w_FFNBsB.js → pt-279GpTd9.js} +1 -1
- package/{pt_PT-B_0lp2gn.js → pt_PT-BJN_NbKk.js} +1 -1
- package/{ru-BMwIL9h7.js → ru--B42Z0fY.js} +1 -1
- package/{ru_RU-Cn23YkbX.js → ru_RU-DvLRsvFF.js} +1 -1
- package/{se-DyqGVlJl.js → se-CkkpOCj9.js} +1 -1
- package/style.css +1 -1
- package/{sv_SE-C0HysA6F.js → sv_SE-DEikn0sU.js} +1 -1
- package/{tr-BtHLqhBn.js → tr-CE07PzgC.js} +1 -1
- package/{tr_TR-CrGV1rx2.js → tr_TR-VIQe6RW6.js} +1 -1
- package/{zh-tw-Do9-Z033.js → zh-tw-Bw_Wnl80.js} +1 -1
- package/{zh_CN-DMJoK1EH.js → zh_CN-14AgMGLZ.js} +1 -1
- package/{zh_TW-CMiGYu2i.js → zh_TW-D1sNldHz.js} +1 -1
package/README.md
CHANGED
|
@@ -1,359 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
# das-web-components 组件库说明文档
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 一、简介
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { createCeTabs } from '@das-fed/upf-web-components'
|
|
7
|
-
createCeTabs('das-ce-tabs')
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
2. **定义 `options` 和 `modelValue` 属性**。
|
|
11
|
-
|
|
12
|
-
`das-ce-tabs` 接收 `options` 和 `modelValue` 属性,`options` 属性配置如下:
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
interface TabOption {
|
|
16
|
-
/** 唯一标识 */
|
|
17
|
-
key: string | number
|
|
18
|
-
/** 选项卡头显示文字 */
|
|
19
|
-
tab: string
|
|
20
|
-
/** 是否禁用 */
|
|
21
|
-
disabled?: boolean
|
|
22
|
-
/** 是否隐藏 */
|
|
23
|
-
hidden?: boolean
|
|
24
|
-
/** 被隐藏时是否渲染 DOM 结构 */
|
|
25
|
-
forceRender?: boolean
|
|
26
|
-
/** tab显示文字插槽 */
|
|
27
|
-
tabSlot?: string
|
|
28
|
-
/** 关闭图标插槽 */
|
|
29
|
-
closeIconSlot?: string
|
|
30
|
-
/** 显示内容插槽 */
|
|
31
|
-
contentSlot?: string
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
定义实例如下:
|
|
36
|
-
|
|
37
|
-
```js
|
|
38
|
-
const activeKey = ref(1)
|
|
39
|
-
|
|
40
|
-
const options = ref([
|
|
41
|
-
{ key: 1, tab: 'Tab 1' },
|
|
42
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
43
|
-
{ key: 3, tab: 'Tab 3' },
|
|
44
|
-
])
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
3. **监听组件事件**
|
|
48
|
-
|
|
49
|
-
使用组件时,监听到的事件对象为 `customEvent` ,该对象中的 `detail` 属性是个数组,数组元素为组件事件的返回值。 `das-ce-tabs` 组件暴露了以下事件:
|
|
50
|
-
|
|
51
|
-
1. `update:modelValue`:当 `modelValue` 属性变化时触发,要实现切换页签时 `activeKey` 属性自动变化,需要监听该事件。
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import { ref } from 'vue'
|
|
55
|
-
import { createCeTabs } from '@das-fed/upf-web-/components'
|
|
56
|
-
createCeTabs('das-ce-tabs')
|
|
57
|
-
|
|
58
|
-
const activeKey = ref(1)
|
|
59
|
-
|
|
60
|
-
const options = ref([
|
|
61
|
-
{ key: 1, tab: 'Tab 1' },
|
|
62
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
63
|
-
{ key: 3, tab: 'Tab 3' },
|
|
64
|
-
])
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```html
|
|
68
|
-
<das-ce-tabs
|
|
69
|
-
:modelValue="activeKey"
|
|
70
|
-
:options="options"
|
|
71
|
-
@update:modelValue="(customEvent) => (activeKey = customEvent.detail[0])"
|
|
72
|
-
></das-ce-tabs>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
2. `tabClick`:当 `tab` 被点击时触发。返回被点击页签的 `key` 值。
|
|
76
|
-
|
|
77
|
-
```js
|
|
78
|
-
import { ref } from 'vue'
|
|
79
|
-
import { createCeTabs } from '@das-fed/upf-web-components/components'
|
|
80
|
-
createCeTabs('das-ce-tabs')
|
|
5
|
+
das-web-components 是 DAS 前端体系的 Web 组件库,基于 Web Components 技术,支持 Vue、React、原生 JS 等多种框架集成,适用于企业级中后台系统的统一架构和快速开发。
|
|
81
6
|
|
|
82
|
-
|
|
7
|
+
---
|
|
83
8
|
|
|
84
|
-
|
|
85
|
-
{ key: 1, tab: 'Tab 1' },
|
|
86
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
87
|
-
{ key: 3, tab: 'Tab 3' },
|
|
88
|
-
])
|
|
9
|
+
## 二、核心组件与用法
|
|
89
10
|
|
|
90
|
-
|
|
91
|
-
console.log('当前点击页签的key: ', customEvent.detail[0])
|
|
92
|
-
}
|
|
93
|
-
```
|
|
11
|
+
### 1. das-ce-tabs 页签组件
|
|
94
12
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
13
|
+
- 支持动态页签、右键菜单、刷新、全屏等功能。
|
|
14
|
+
- 通过 `createCeTabs('das-ce-tabs')` 注册。
|
|
15
|
+
- 主要属性:
|
|
16
|
+
- `options`:页签配置数组,支持禁用、隐藏、插槽等。
|
|
17
|
+
- `modelValue`:当前激活页签 key。
|
|
18
|
+
- 主要事件:
|
|
19
|
+
- `update:modelValue`:切换页签时触发,返回新激活 key。
|
|
20
|
+
- `tabClick`:点击页签时触发,返回 key。
|
|
21
|
+
- `tabDelete`:删除页签时触发,返回 key。
|
|
22
|
+
- `menuClick`:右键菜单操作,返回操作项和页签对象。
|
|
23
|
+
- `pageRefresh`:点击刷新按钮时触发。
|
|
24
|
+
- `toggleFullScreen`:切换全屏。
|
|
25
|
+
- 主要方法与类型定义见下方代码示例。
|
|
98
26
|
|
|
99
|
-
|
|
27
|
+
#### 用法示例
|
|
100
28
|
|
|
101
29
|
```js
|
|
102
30
|
import { ref } from 'vue'
|
|
103
|
-
import { createCeTabs } from '@das-fed/
|
|
31
|
+
import { createCeTabs } from '@das-fed/web-components'
|
|
104
32
|
createCeTabs('das-ce-tabs')
|
|
105
33
|
|
|
106
34
|
const activeKey = ref(1)
|
|
107
|
-
|
|
108
35
|
const options = ref([
|
|
109
36
|
{ key: 1, tab: 'Tab 1' },
|
|
110
37
|
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
111
38
|
{ key: 3, tab: 'Tab 3' },
|
|
112
39
|
])
|
|
113
|
-
|
|
114
|
-
const tabDelete = (customEvent) => {
|
|
115
|
-
console.log('当前删除页签的key:', customEvent.detail[0])
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
```html
|
|
120
|
-
<das-ce-tabs :modelValue="activeKey" :options="options" @tabDelete="tabDelete"></das-ce-tabs>
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
4. `menuClick`:当右键呼出的操作项选中时触发。返回被选中的操作项和当前右键操作的页签对象。
|
|
124
|
-
|
|
125
|
-
```js
|
|
126
|
-
import { ref } from 'vue'
|
|
127
|
-
import { createCeTabs } from '@das-fed/upf-web-components/components'
|
|
128
|
-
createCeTabs('das-ce-tabs')
|
|
129
|
-
|
|
130
|
-
const activeKey = ref(1)
|
|
131
|
-
|
|
132
|
-
const options = ref([
|
|
133
|
-
{ key: 1, tab: 'Tab 1' },
|
|
134
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
135
|
-
{ key: 3, tab: 'Tab 3' },
|
|
136
|
-
])
|
|
137
|
-
|
|
138
|
-
const menuClick = (customEvent) => {
|
|
139
|
-
console.log('当前选中操作项:', customEvent.detail[0], '当前页签对象:', customEvent.detail[1])
|
|
140
|
-
}
|
|
141
40
|
```
|
|
142
41
|
|
|
143
42
|
```html
|
|
144
43
|
<das-ce-tabs :modelValue="activeKey" :options="options" @menuClick="menuClick"></das-ce-tabs>
|
|
145
44
|
```
|
|
146
45
|
|
|
147
|
-
|
|
46
|
+
#### 事件与类型
|
|
148
47
|
|
|
149
48
|
```js
|
|
150
49
|
interface MenuListType {
|
|
151
|
-
/** 唯一标识 */
|
|
152
50
|
key: string | number
|
|
153
|
-
/** 操作项名称 */
|
|
154
51
|
name: string
|
|
155
|
-
/** 是否隐藏 */
|
|
156
52
|
hidden?: boolean | Function
|
|
157
|
-
/** 是否禁用 */
|
|
158
53
|
disabled?: boolean | Function
|
|
159
54
|
}
|
|
160
55
|
```
|
|
161
56
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```js
|
|
165
|
-
import { ref } from 'vue'
|
|
166
|
-
import { createCeTabs } from '@das-fed/upf-web-components/components'
|
|
167
|
-
createCeTabs('das-ce-tabs')
|
|
168
|
-
|
|
169
|
-
const activeKey = ref(1)
|
|
170
|
-
|
|
171
|
-
const options = ref([
|
|
172
|
-
{ key: 1, tab: 'Tab 1' },
|
|
173
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
174
|
-
{ key: 3, tab: 'Tab 3' },
|
|
175
|
-
])
|
|
57
|
+
---
|
|
176
58
|
|
|
177
|
-
|
|
178
|
-
console.log('刷新')
|
|
179
|
-
}
|
|
180
|
-
```
|
|
59
|
+
### 2. das-ce-nav 顶部导航栏组件
|
|
181
60
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
61
|
+
- 支持菜单、logo、搜索、用户信息、项目树、内置页面等多种功能。
|
|
62
|
+
- 通过 `createCeNav('das-ce-nav')` 注册。
|
|
63
|
+
- 主要属性:
|
|
64
|
+
- `modelValue`:当前选中菜单 key。
|
|
65
|
+
- `config`:导航栏配置。
|
|
66
|
+
- `logoUrl`、`searchConfig`、`userInfoConfig`、`projectTreeConfig`、`innerPagesConfig` 等。
|
|
67
|
+
- 主要事件:
|
|
68
|
+
- `handleTabClick`、`handleTabDelete`、`changeInnerPage`、`searchToPage`、`clearSearchList`、`deleteSearchItem`、`userCommandHandle`、`changeTreeHandle`。
|
|
69
|
+
- 详细属性与事件见下方表格。
|
|
185
70
|
|
|
186
|
-
|
|
71
|
+
#### 用法示例
|
|
187
72
|
|
|
188
73
|
```js
|
|
189
|
-
import {
|
|
190
|
-
import { createCeTabs } from '@das-fed/upf-web-components/components'
|
|
191
|
-
createCeTabs('das-ce-tabs')
|
|
192
|
-
|
|
193
|
-
const activeKey = ref(1)
|
|
194
|
-
|
|
195
|
-
const options = ref([
|
|
196
|
-
{ key: 1, tab: 'Tab 1' },
|
|
197
|
-
{ key: 2, tab: 'Tab 2', disabled: true },
|
|
198
|
-
{ key: 3, tab: 'Tab 3' },
|
|
199
|
-
])
|
|
200
|
-
|
|
201
|
-
const toggleFullScreen = () => {
|
|
202
|
-
console.log('全屏')
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
```html
|
|
207
|
-
<das-ce-tabs :modelValue="activeKey" :options="options" @toggleFullScreen="toggleFullScreen"></das-ce-tabs>
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## das-ce-nav 使用方法
|
|
211
|
-
|
|
212
|
-
### 1. **引入 `das-ce-nav` 组件并注册**。
|
|
213
|
-
|
|
214
|
-
```js
|
|
215
|
-
import { createCeNav } from '@das-fed/upf-web-components'
|
|
74
|
+
import { createCeNav } from '@das-fed/web-components'
|
|
216
75
|
createCeNav('das-ce-nav')
|
|
217
76
|
```
|
|
218
77
|
|
|
219
|
-
#### ① 在 vue 文件中使用
|
|
220
|
-
|
|
221
78
|
```html
|
|
222
79
|
<das-ce-nav
|
|
223
80
|
@update:modelValue="(event) => (activeKey = event.detail[0])"
|
|
224
81
|
:modelValue="activeKey"
|
|
225
|
-
@handleTabClick="handleTabClick"
|
|
226
|
-
@handleTabDelete="handleTabDelete"
|
|
227
82
|
:config="config"
|
|
228
83
|
:logoUrl="logoUrl"
|
|
229
84
|
:searchConfig="searchConfig"
|
|
230
|
-
@searchToPage="searchToPage"
|
|
231
|
-
@clearSearchList="clearSearchList"
|
|
232
|
-
@deleteSearchItem="deleteSearchItem"
|
|
233
85
|
:userInfoConfig="userInfoConfig"
|
|
234
|
-
@userCommandHandle="userCommandHandle"
|
|
235
86
|
:projectTreeConfig="projectTreeConfig"
|
|
236
|
-
@changeTreeHandle="changeTreeHandle"
|
|
237
87
|
:innerPagesConfig="innerPagesConfig"
|
|
238
|
-
@changeInnerPage="changeInnerPage"
|
|
239
88
|
></das-ce-nav>
|
|
240
89
|
```
|
|
241
90
|
|
|
242
|
-
####
|
|
243
|
-
|
|
244
|
-
```html
|
|
245
|
-
<head>
|
|
246
|
-
<script type="module">
|
|
247
|
-
import { createCeNav } from '@das-fed/upf-web-components'
|
|
248
|
-
createCeNav('das-ce-nav')
|
|
249
|
-
const handleTabClick = (event) => {
|
|
250
|
-
console.log(event)
|
|
251
|
-
}
|
|
252
|
-
const dasceNavEle = document.getElementsByTagName('das-ce-nav')[0]
|
|
253
|
-
dasceNavEle.addEventListener('handleTabClick', handleTabClick)
|
|
254
|
-
</script>
|
|
255
|
-
</head>
|
|
256
|
-
<body>
|
|
257
|
-
<das-ce-nav
|
|
258
|
-
@update:modelValue="(event) => (activeKey = event.detail[0])"
|
|
259
|
-
:modelValue="activeKey"
|
|
260
|
-
:config="config"
|
|
261
|
-
:logoUrl="logoUrl"
|
|
262
|
-
:searchConfig="searchConfig"
|
|
263
|
-
:userInfoConfig="userInfoConfig"
|
|
264
|
-
:projectTreeConfig="projectTreeConfig"
|
|
265
|
-
:innerPagesConfig="innerPagesConfig"
|
|
266
|
-
></das-ce-nav>
|
|
267
|
-
</body>
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### 2. **属性**
|
|
271
|
-
|
|
272
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
273
|
-
| ----------------- | ------------- | ----------------------------------------- | ----------------------------------------- | -------- |
|
|
274
|
-
| modelValue | 当前选中菜单 | string/number | - | 是 |
|
|
275
|
-
| config | 导航栏配置 | [config](###config) | [config](###config) | 是 |
|
|
276
|
-
| logoUrl | logo 图片链接 | string | - | 否 |
|
|
277
|
-
| innerPagesConfig | 内置页面配置 | [innerPagesConfig](###innerPagesConfig) | [innerPagesConfig](###innerPagesConfig) | 否 |
|
|
278
|
-
| searchConfig | 搜索配置 | [searchConfig](###searchConfig) | [searchConfig](###searchConfig) | 否 |
|
|
279
|
-
| userInfoConfig | 用户信息配置 | [userInfoConfig](###userInfoConfig) | [userInfoConfig](###userInfoConfig) | 否 |
|
|
280
|
-
| projectTreeConfig | 项目树配置 | [projectTreeConfig](###projectTreeConfig) | [projectTreeConfig](###projectTreeConfig) | 否 |
|
|
281
|
-
|
|
282
|
-
### config
|
|
283
|
-
|
|
284
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
285
|
-
| --------------- | ------------------ | ---------------------------------- | ------ | -------- |
|
|
286
|
-
| showSearch | 是否显示搜索 | bool | false | 否 |
|
|
287
|
-
| showProjectTree | 是否显示项目下拉树 | bool | false | 否 |
|
|
288
|
-
| subAppList | 导航栏菜单数据 | {name:string,code:string/number}[] | - | 否 |
|
|
289
|
-
|
|
290
|
-
### innerPagesConfig
|
|
291
|
-
|
|
292
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
293
|
-
| ------------------- | ------------------ | ------------------------------- | ------ | -------- |
|
|
294
|
-
| activeInnerPagePath | 内置菜单当前选中值 | string/number | false | 否 |
|
|
295
|
-
| innerPages | 内置菜单数据 | {title: string, path: string}[] | false | 否 |
|
|
296
|
-
|
|
297
|
-
### searchConfig
|
|
298
|
-
|
|
299
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
300
|
-
| -------------- | ---------------- | ----------------------------- | --------------------------- | -------- |
|
|
301
|
-
| defaultProps | - | {value: string,label: string} | {value: 'id',label: 'name'} | 否 |
|
|
302
|
-
| getHistoryList | 获取历史搜索记录 | () => Promise<any> | - | 否 |
|
|
303
|
-
| getSearchList | 获取菜单 | () => Promise<any> | - | 否 |
|
|
304
|
-
| addHistory | 添加历史记录 | (data:any) => void | - | 否 |
|
|
91
|
+
#### 主要属性与事件
|
|
305
92
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
|
309
|
-
|
|
|
310
|
-
|
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
317
|
-
| ------------------- | ---------------------------------- | ------------------------------------------------------------------ | --------------------------- | -------- |
|
|
318
|
-
| projectStore | 项目数据 | - | 否 |
|
|
319
|
-
| defaultProps | - | {value: string,label: string} | {value: 'id',label: 'name'} | 否 |
|
|
320
|
-
| treeProps | 树组件配置 | [TreeOptionProps](###TreeOptionProps) | - | 否 |
|
|
321
|
-
| filterNode | 搜索过滤 | (value: any, data: any) => [projectTreeType](###projectTreeType)[] | - | 否 |
|
|
322
|
-
| filterFlatCondition | 树切换平铺,符合条件的加入平铺列表 | (data: any) => boolean[] | - | 否 |
|
|
323
|
-
|
|
324
|
-
### TreeOptionProps
|
|
325
|
-
|
|
326
|
-
```js
|
|
327
|
-
interface TreeOptionProps {
|
|
328
|
-
label?: string // 默认name
|
|
329
|
-
pathName?: string // 默认pathName
|
|
330
|
-
children?: string // 默认children
|
|
331
|
-
parentId?: string // 默认parentId
|
|
332
|
-
disabled?: string | ((data: TreeNodeData, node?: Node) => boolean) // 默认disabled
|
|
333
|
-
isLeaf?: string | ((data: TreeNodeData, node?: Node) => boolean) // 默认leaf;懒加载不支持方法
|
|
334
|
-
// 允许取消选中(keepSelected为true时生效)
|
|
335
|
-
allowUnSelect?: string | ((data: TreeNodeData) => boolean) // 默认allowUnSelect
|
|
336
|
-
class?: (
|
|
337
|
-
data: TreeNodeData,
|
|
338
|
-
node: Node,
|
|
339
|
-
) =>
|
|
340
|
-
| string
|
|
341
|
-
| {
|
|
342
|
-
[key: string]: boolean
|
|
343
|
-
}
|
|
344
|
-
| string
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
### projectTreeType
|
|
349
|
-
|
|
350
|
-
| 属性名 | 描述 | 类型 | 默认值 | 是否必填 |
|
|
351
|
-
| -------- | ------------------------------------------ | ------------------------------------- | ------ | -------- |
|
|
352
|
-
| - | 唯一标识(可使用 defaultProps.value 配置) | id | 是 |
|
|
353
|
-
| - | 项目名称(可使用 defaultProps.label 配置) | name | 是 |
|
|
354
|
-
| children | 树组件配置 | [projectTreeType](###projectTreeType) | - | 否 |
|
|
355
|
-
|
|
356
|
-
### 3. **事件**
|
|
93
|
+
| 属性名 | 描述 | 类型 | 是否必填 |
|
|
94
|
+
| ----------------- | ------------- | ------------- | -------- |
|
|
95
|
+
| modelValue | 当前选中菜单 | string/number | 是 |
|
|
96
|
+
| config | 导航栏配置 | object | 是 |
|
|
97
|
+
| logoUrl | logo 图片链接 | string | 否 |
|
|
98
|
+
| innerPagesConfig | 内置页面配置 | object | 否 |
|
|
99
|
+
| searchConfig | 搜索配置 | object | 否 |
|
|
100
|
+
| userInfoConfig | 用户信息配置 | object | 否 |
|
|
101
|
+
| projectTreeConfig | 项目树配置 | object | 否 |
|
|
357
102
|
|
|
358
103
|
| 事件 | 说明 | 回调参数 |
|
|
359
104
|
| ----------------- | --------------------------- | ------------------------------- |
|
|
@@ -366,17 +111,29 @@ interface TreeOptionProps {
|
|
|
366
111
|
| userCommandHandle | 用户信息-操作项 | function(value:any) |
|
|
367
112
|
| changeTreeHandle | 项目树-是否确定切换选中项目 | function(status:bool,value:any) |
|
|
368
113
|
|
|
369
|
-
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### 3. das-ce-menu 侧边菜单栏组件
|
|
117
|
+
|
|
118
|
+
- 支持菜单折叠、选中、动态数据等功能。
|
|
119
|
+
- 通过 `createCeMenu('das-ce-menu')` 注册。
|
|
120
|
+
- 主要属性:
|
|
121
|
+
- `modelValue`:当前选中菜单 key。
|
|
122
|
+
- `data`:菜单数据数组。
|
|
123
|
+
- `collapse`:菜单栏初始折叠状态。
|
|
124
|
+
- 主要事件:
|
|
125
|
+
- `change`:选中项改变时触发。
|
|
126
|
+
- `collapse-change`:菜单折叠状态改变时触发。
|
|
127
|
+
- 主要方法:
|
|
128
|
+
- `changeCollapse`:切换菜单折叠状态。
|
|
370
129
|
|
|
371
|
-
|
|
130
|
+
#### 用法示例
|
|
372
131
|
|
|
373
132
|
```js
|
|
374
|
-
import { createCeMenu } from '@das-fed/
|
|
133
|
+
import { createCeMenu } from '@das-fed/web-components'
|
|
375
134
|
createCeMenu('das-ce-menu')
|
|
376
135
|
```
|
|
377
136
|
|
|
378
|
-
2. **使用**。
|
|
379
|
-
|
|
380
137
|
```html
|
|
381
138
|
<das-ce-menu
|
|
382
139
|
:data="menuData"
|
|
@@ -388,23 +145,23 @@ createCeMenu('das-ce-menu')
|
|
|
388
145
|
></das-ce-menu>
|
|
389
146
|
```
|
|
390
147
|
|
|
391
|
-
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 三、组件属性与类型定义
|
|
151
|
+
|
|
152
|
+
详细属性、类型定义和事件请参考源码及注释。
|
|
153
|
+
|
|
154
|
+
---
|
|
392
155
|
|
|
393
|
-
|
|
394
|
-
| ---------- | ------------------ | ------------- | ------ | -------- |
|
|
395
|
-
| modelValue | 当前选中菜单 | string/number | - | 是 |
|
|
396
|
-
| data | 导航栏配置 | array | [] | 是 |
|
|
397
|
-
| collapse | 菜单栏初始折叠状态 | boolean | false | 否 |
|
|
156
|
+
## 四、常见问题与扩展
|
|
398
157
|
|
|
399
|
-
|
|
158
|
+
- 支持在 Vue、React、原生 JS 项目中直接注册和使用。
|
|
159
|
+
- 组件事件均通过 `customEvent.detail` 获取返回值。
|
|
160
|
+
- 支持自定义插槽、动态数据、复杂交互。
|
|
161
|
+
- 推荐结合 DAS Web 主应用统一布局和微前端架构使用。
|
|
400
162
|
|
|
401
|
-
|
|
402
|
-
| --------------- | ---------------- | ------------------------------------------- |
|
|
403
|
-
| change | 选中项改变触发 | function(value: string/number, option: any) |
|
|
404
|
-
| collapse-change | 折叠状态改变触发 | function(value:boolean) |
|
|
163
|
+
---
|
|
405
164
|
|
|
406
|
-
|
|
165
|
+
## 五、贡献与维护
|
|
407
166
|
|
|
408
|
-
|
|
409
|
-
| -------------- | ------------ | ------------------------------ |
|
|
410
|
-
| changeCollapse | 切换折叠状态 | 接收一个布尔类型参数:折叠状态 |
|
|
167
|
+
如需详细 API 说明、组件开发指南,请参考源码及注释。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as t, o, b as a, w as e, v as i, x as r, u as n, y as c } from "./index-
|
|
1
|
+
import { d as t, o, b as a, w as e, v as i, x as r, u as n, y as c } from "./index-BQf2PYFs.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1684811406838" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14190" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12"><path d="M512 849.5c186.384375 0 337.5-151.115625 337.5-337.5S698.384375 174.5 512 174.5 174.5 325.615625 174.5 512s151.115625 337.5 337.5 337.5z m0 56.25C294.5375 905.75 118.25 729.4625 118.25 512S294.5375 118.25 512 118.25s393.75 176.2875 393.75 393.75-176.2875 393.75-393.75 393.75z m0-253.125a42.1875 42.1875 0 1 1 0 84.375 42.1875 42.1875 0 0 1 0-84.375z m0-365.625a112.5 112.5 0 0 1 112.5 112.5v9.61875c0 28.321875-11.25 55.4625-31.246875 75.4875l-17.353125 17.325c-9.253125 9.28125-17.578125 19.40625-24.834375 30.31875-7.14375 10.6875-10.940625 23.259375-10.940625 36.084375A28.125 28.125 0 0 1 483.875 568.25v-5.625c0-20.25 5.990625-39.99375 17.184375-56.8125 11.446875-17.15625 24.553125-33.13125 39.121875-47.728125l6.46875-6.46875A73.715625 73.715625 0 0 0 568.25 399.5a56.25 56.25 0 1 0-112.5 0 28.125 28.125 0 0 1-56.25 0 112.5 112.5 0 0 1 112.5-112.5z" p-id="14191"></path></svg>', m = /* @__PURE__ */ t({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(w) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o, b as a, w as e, v as i, x as l, u as t, y as r } from "./index-
|
|
1
|
+
import { d as n, o, b as a, w as e, v as i, x as l, u as t, y as r } from "./index-BQf2PYFs.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1680860959118" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11369" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 170.666667m85.333333 0l0 0q85.333333 0 85.333334 85.333333l0 512q0 85.333333-85.333334 85.333333l0 0q-85.333333 0-85.333333-85.333333l0-512q0-85.333333 85.333333-85.333333Z" p-id="11370"></path><path d="M597.333333 170.666667m85.333334 0l0 0q85.333333 0 85.333333 85.333333l0 512q0 85.333333-85.333333 85.333333l0 0q-85.333333 0-85.333334-85.333333l0-512q0-85.333333 85.333334-85.333333Z" p-id="11371"></path></svg>', h = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(w) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o as t, b as o, w as e, v as i, x as r, u as s, y as h } from "./index-
|
|
1
|
+
import { d as n, o as t, b as o, w as e, v as i, x as r, u as s, y as h } from "./index-BQf2PYFs.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1677654702624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8626" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 192v64H128v192h768V256h-128V192h128a64 64 0 0 1 63.84 59.2L960 256v576a64 64 0 0 1-59.2 63.84L896 896H128a64 64 0 0 1-63.84-59.2L64 832V256a64 64 0 0 1 59.2-63.84L128 192h128z m640 320H128v320h768V512zM352 128a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0V160a32 32 0 0 1 32-32z m320 0a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0V160a32 32 0 0 1 32-32z m-96 64v64h-128V192h128z" p-id="8627"></path></svg>', d = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(v) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o, b as a, w as e, v as r, x as i, u as t, y as c } from "./index-
|
|
1
|
+
import { d as n, o, b as a, w as e, v as r, x as i, u as t, y as c } from "./index-BQf2PYFs.js";
|
|
2
2
|
const p = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1680860877984" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11230" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M711.466667 464.512c2.816 2.56 5.376 5.504 7.68 8.661333 19.029333 26.197333 15.573333 64.853333-7.68 86.314667L381.44 863.872a50.773333 50.773333 0 0 1-34.432 13.824c-30.037333 0-54.4-27.434667-54.4-61.312V207.616c0-14.165333 4.352-27.861333 12.288-38.826667 19.029333-26.24 53.333333-30.08 76.544-8.661333l330.069333 304.384z" p-id="11231"></path></svg>', h = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(w) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o, b as a, w as e, v as i, x as r, u as t, y as p } from "./index-
|
|
1
|
+
import { d as n, o, b as a, w as e, v as i, x as r, u as t, y as p } from "./index-BQf2PYFs.js";
|
|
2
2
|
const w = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668396781886" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17035" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M297.376 182.624a32 32 0 1 1 45.248-45.248l352 352a32 32 0 0 1 0 45.248l-352 352a32 32 0 1 1-45.248-45.248L626.752 512 297.376 182.624z" p-id="17036"></path></svg>', h = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(c) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o as e, b as o, w as s, v as a, x as i, u as r, y as l } from "./index-
|
|
1
|
+
import { d as n, o as e, b as o, w as s, v as a, x as i, u as r, y as l } from "./index-BQf2PYFs.js";
|
|
2
2
|
const d = `<?xml version="1.0" encoding="UTF-8"?>\r
|
|
3
3
|
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
|
|
4
4
|
<title>树展开</title>\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as n, o as t, b as e, w as o, v as a, x as r, u as c, y as i } from "./index-
|
|
1
|
+
import { d as n, o as t, b as e, w as o, v as a, x as r, u as c, y as i } from "./index-BQf2PYFs.js";
|
|
2
2
|
const h = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1669969511811" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3001" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M96 384c19.2 0 32-12.8 32-32V128h224c19.2 0 32-12.8 32-32S371.2 64 352 64h-256c-19.2 0-32 12.8-32 32v256c0 19.2 12.8 32 32 32zM416 576h-256c-19.2 0-32 12.8-32 32s12.8 32 32 32h179.2l-262.4 262.4c-12.8 12.8-12.8 32 0 44.8 12.8 12.8 32 12.8 44.8 0L384 684.8v179.2c0 19.2 12.8 32 32 32s32-12.8 32-32v-256c0-19.2-12.8-32-32-32zM896 416c0-19.2-12.8-32-32-32h-179.2l262.4-262.4c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L640 339.2V160c0-19.2-12.8-32-32-32s-32 12.8-32 32v256c0 19.2 12.8 32 32 32h256c19.2 0 32-12.8 32-32zM928 640c-19.2 0-32 12.8-32 32V896h-224c-19.2 0-32 12.8-32 32s12.8 32 32 32h256c19.2 0 32-12.8 32-32v-256c0-19.2-12.8-32-32-32z" p-id="3002"></path></svg>', v = /* @__PURE__ */ n({
|
|
3
3
|
__name: "index",
|
|
4
4
|
setup(l) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as t, o as e, b as o, w as s, v as a, x as i, u as r, y as l } from "./index-
|
|
1
|
+
import { d as t, o as e, b as o, w as s, v as a, x as i, u as r, y as l } from "./index-BQf2PYFs.js";
|
|
2
2
|
const d = `<?xml version="1.0" encoding="UTF-8"?>\r
|
|
3
3
|
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\r
|
|
4
4
|
<title>解锁</title>\r
|