m8-codex-mcp 1.0.0

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.
Files changed (110) hide show
  1. package/README.md +113 -0
  2. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/000-/347/273/204/344/273/266/345/272/223/344/270/213/350/275/275/344/275/277/347/224/250.md +188 -0
  3. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/001-actionsheet/345/212/250/344/275/234/351/235/242/346/235/277.md +460 -0
  4. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/004-amap/345/234/260/345/233/276.md +285 -0
  5. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/005-button/346/214/211/351/222/256.md +211 -0
  6. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/008-cell/345/215/225/345/205/203/346/240/274.md +213 -0
  7. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/009-checkbox/345/244/215/351/200/211/346/241/206.md +501 -0
  8. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/010-circle/347/216/257/345/275/242/350/277/233/345/272/246/346/235/241.md +168 -0
  9. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/011-datepicker/346/227/245/346/234/237/351/200/211/346/213/251.md +617 -0
  10. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/013-field/350/276/223/345/205/245/346/241/206.md +539 -0
  11. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/015-form/350/241/250/345/215/225.md +999 -0
  12. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/018-header/345/244/264/351/203/250/345/257/274/350/210/252/346/240/217.md +150 -0
  13. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/019-icon/345/233/276/346/240/207.md +133 -0
  14. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/020-loading/345/212/240/350/275/275.md +117 -0
  15. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/021-noticebar/351/200/232/347/237/245/346/240/217.md +152 -0
  16. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/022-numberkeyboard/346/225/260/345/255/227/351/224/256/347/233/230.md +427 -0
  17. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/023-pagination/345/210/206/351/241/265.md +212 -0
  18. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/024-panel/351/235/242/346/235/277.md +85 -0
  19. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/025-passwordinput/345/257/206/347/240/201/350/276/223/345/205/245/346/241/206.md +175 -0
  20. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/026-picker/351/200/211/346/213/251/345/231/250.md +519 -0
  21. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/027-popup/345/274/271/345/207/272/345/261/202.md +152 -0
  22. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/028-progress/350/277/233/345/272/246/346/235/241.md +103 -0
  23. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/029-radio/345/215/225/351/200/211/346/241/206.md +285 -0
  24. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/030-rate/350/257/204/345/210/206.md +189 -0
  25. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/031-search/346/220/234/347/264/242.md +217 -0
  26. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/032-slider/346/273/221/345/235/227.md +166 -0
  27. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/033-stepper/346/255/245/350/277/233/345/231/250.md +340 -0
  28. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/035-swipecell/346/273/221/345/212/250/345/215/225/345/205/203/346/240/274.md +265 -0
  29. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/036-switch/345/274/200/345/205/263.md +196 -0
  30. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/037-switchcell/345/274/200/345/205/263/345/215/225/345/205/203/346/240/274.md +115 -0
  31. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/038-tag/346/240/207/350/256/260.md +232 -0
  32. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/039-treeselect/345/210/206/347/261/273/351/200/211/346/213/251.md +631 -0
  33. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/040-uploader/346/226/207/344/273/266/344/270/212/344/274/240.md +531 -0
  34. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/041-verifycode/351/252/214/350/257/201/347/240/201.md +111 -0
  35. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/042-minirefresh/344/270/213/346/213/211/345/210/267/346/226/260.md +337 -0
  36. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/043-layout/345/270/203/345/261/200.md +150 -0
  37. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/044-image/345/233/276/347/211/207.md +144 -0
  38. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/045-toast/350/275/273/346/217/220/347/244/272.md +429 -0
  39. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/046-calendar/346/227/245/345/216/206.md +467 -0
  40. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/047-area/347/234/201/345/270/202/345/214/272/351/200/211/346/213/251.md +295 -0
  41. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/048-tab/346/240/207/347/255/276/351/241/265.md +577 -0
  42. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/049-dialog/345/274/271/345/207/272/346/241/206.md +491 -0
  43. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/050-dropdownmenu/344/270/213/346/213/211/350/217/234/345/215/225.md +265 -0
  44. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/051-notify/346/266/210/346/201/257/351/200/232/347/237/245.md +203 -0
  45. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/052-overlay/351/201/256/347/275/251/345/261/202.md +139 -0
  46. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/053-collapse/346/212/230/345/217/240/351/235/242/346/235/277.md +199 -0
  47. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/054-grid/345/256/253/346/240/274.md +183 -0
  48. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/055-countdown/345/200/222/350/256/241/346/227/266.md +289 -0
  49. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/056-divider/345/210/206/345/211/262/347/272/277.md +97 -0
  50. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/057-empty/347/251/272/347/212/266/346/200/201.md +146 -0
  51. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/058-imagepreview/345/233/276/347/211/207/351/242/204/350/247/210.md +292 -0
  52. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/059-lazyload/346/207/222/345/212/240/350/275/275.md +120 -0
  53. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/060-skeleton/351/252/250/346/236/266/345/261/217.md +114 -0
  54. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/061-steps/346/255/245/351/252/244/346/235/241.md +119 -0
  55. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/062-sticky/347/262/230/346/200/247/345/270/203/345/261/200.md +208 -0
  56. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/063-indexbar/347/264/242/345/274/225/346/240/217.md +161 -0
  57. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/064-sidebar/344/276/247/350/276/271/345/257/274/350/210/252.md +248 -0
  58. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/065-tabbar/346/240/207/347/255/276/346/240/217.md +314 -0
  59. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/066-badge/345/276/275/346/240/207.md +162 -0
  60. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/067-popover/346/260/224/346/263/241/345/274/271/345/207/272/346/241/206.md +325 -0
  61. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/068-cascader/347/272/247/350/201/224/351/200/211/346/213/251.md +360 -0
  62. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/069-selectperson/351/200/211/344/272/272/347/273/204/344/273/266.md +595 -0
  63. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/070-swipe/350/275/256/346/222/255.md +262 -0
  64. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/071-/345/233/275/351/231/205/345/214/226.md +51 -0
  65. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/072-easycalendar/346/227/245/345/216/206.md +132 -0
  66. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/073-qrcode/344/272/214/347/273/264/347/240/201.md +1538 -0
  67. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/074-imagescale/345/233/276/347/211/207/350/243/201/345/211/252.md +261 -0
  68. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/075-dragsort/346/213/226/346/213/275/346/216/222/345/272/217.md +161 -0
  69. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/076-chart/345/233/276/350/241/250.md +381 -0
  70. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/077-rtc/351/237/263/350/247/206/351/242/221.md +531 -0
  71. package/data/m8mpdoc/UI/347/273/204/344/273/266/345/272/223/078-table/350/241/250/346/240/274.md +849 -0
  72. package/data/m8mpdoc//345/205/270/345/236/213/346/241/210/344/276/213/003-/345/210/227/350/241/250/350/257/246/346/203/205.md +247 -0
  73. package/data/m8mpdoc//345/205/270/345/236/213/346/241/210/344/276/213/003-/345/210/227/350/241/250/350/257/246/346/203/205vue3.md +276 -0
  74. package/data/m8mpdoc//345/205/270/345/236/213/346/241/210/344/276/213/003-/350/241/250/345/215/225/346/217/220/344/272/244.md +130 -0
  75. package/data/m8mpdoc//345/205/270/345/236/213/346/241/210/344/276/213/003-/350/241/250/345/215/225/346/217/220/344/272/244vue3.md +115 -0
  76. package/data/m8mpdoc//346/240/270/345/277/203/351/200/232/347/224/250Util/345/267/245/345/205/267/345/272/223/Ajax/344/270/216/346/226/207/344/273/266/344/270/212/344/274/240.md +456 -0
  77. package/data/m8mpdoc//346/240/270/345/277/203/351/200/232/347/224/250Util/345/267/245/345/205/267/345/272/223//345/267/245/345/205/267/345/207/275/346/225/260/345/272/223.md +398 -0
  78. package/data/standards/01-project/naming.md +158 -0
  79. package/data/standards/01-project/structure.md +106 -0
  80. package/data/standards/01-project/version-detection.md +195 -0
  81. package/data/standards/02-vue/basic.md +242 -0
  82. package/data/standards/02-vue/component.md +299 -0
  83. package/data/standards/02-vue/examples.md +240 -0
  84. package/data/standards/02-vue/performance.md +74 -0
  85. package/data/standards/02-vue/state-management.md +293 -0
  86. package/data/standards/03-css/index.md +165 -0
  87. package/data/standards/04-api/ajax.md +178 -0
  88. package/data/standards/04-api/ejs-api.md +192 -0
  89. package/data/standards/04-api/util.md +166 -0
  90. package/data/standards/05-typescript/index.md +166 -0
  91. package/data/standards/06-mock/index.md +154 -0
  92. package/data/standards/07-router/index.md +141 -0
  93. package/data/standards/README.md +82 -0
  94. package/data/standards/_index.md +215 -0
  95. package/dist/index.d.ts +10 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +2 -0
  98. package/dist/knowledge/index.d.ts +36 -0
  99. package/dist/knowledge/index.d.ts.map +1 -0
  100. package/dist/knowledge/index.js +1 -0
  101. package/dist/templates/vue2.d.ts +41 -0
  102. package/dist/templates/vue2.d.ts.map +1 -0
  103. package/dist/templates/vue2.js +1 -0
  104. package/dist/templates/vue3.d.ts +41 -0
  105. package/dist/templates/vue3.d.ts.map +1 -0
  106. package/dist/templates/vue3.js +1 -0
  107. package/dist/tools/generate_module_structure.d.ts +21 -0
  108. package/dist/tools/generate_module_structure.d.ts.map +1 -0
  109. package/dist/tools/generate_module_structure.js +1 -0
  110. package/package.json +47 -0
@@ -0,0 +1,631 @@
1
+ # 组件使用
2
+
3
+ ## treeselect 分类选择
4
+
5
+ ### 介绍
6
+
7
+ - 分类选择组件。
8
+
9
+ ### 代码演示
10
+
11
+ #### 单选模式
12
+
13
+ `item`为分类显示所需的数据,数据格式见下方示例。`main-active-index`表示左侧高亮选项的索引,`active-id`表示右侧高亮选项的 `id`
14
+
15
+ ::: ifdef M83
16
+
17
+ ```html
18
+ <em-tree-select
19
+ :items="items"
20
+ :active-id.sync="activeId"
21
+ :main-active-index.sync="activeIndex"
22
+ @click-nav="onNavClick"
23
+ @click-item="onItemClick"
24
+ ></em-tree-select>
25
+ <em-toast ref="emToast"></em-toast>
26
+ ```
27
+
28
+ ```js
29
+ export default {
30
+ data() {
31
+ return {
32
+ items: [
33
+ {
34
+ text: '所有城市',
35
+ children: [
36
+ {
37
+ text: '温州',
38
+ id: 1,
39
+ disabled: true
40
+ },
41
+ {
42
+ text: '杭州',
43
+ id: 2
44
+ },
45
+ {
46
+ text: '南京',
47
+ id: 3
48
+ },
49
+ {
50
+ text: '苏州',
51
+ id: 4
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ text: '浙江',
57
+ children: [
58
+ {
59
+ text: '温州',
60
+ id: 1,
61
+ disabled: true
62
+ },
63
+ {
64
+ text: '杭州',
65
+ id: 2
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ text: '江苏',
71
+ children: [
72
+ {
73
+ text: '南京',
74
+ id: 3
75
+ },
76
+ {
77
+ text: '苏州',
78
+ id: 4
79
+ }
80
+ ]
81
+ }
82
+ ],
83
+ activeId: 1,
84
+ activeIndex: 1
85
+ };
86
+ },
87
+ methods: {
88
+ onNavClick(index) {
89
+ Toast({
90
+ message: `触发点击事件,index:${index}`
91
+ });
92
+ },
93
+ onItemClick(item) {
94
+ Toast({
95
+ message: `触发点击事件,item:${JSON.stringify(item)}`
96
+ });
97
+ }
98
+ }
99
+ };
100
+ ```
101
+
102
+ ::: endif
103
+ ::: ifdef M84
104
+
105
+ ```html
106
+ <em-tree-select
107
+ :items="items"
108
+ :v-model:active-id="activeId"
109
+ :v-model:main-active-index="activeIndex"
110
+ @click-nav="onNavClick"
111
+ @click-item="onItemClick"
112
+ ></em-tree-select>
113
+ <em-toast ref="emToastRef"></em-toast>
114
+ ```
115
+
116
+ ```js
117
+ import { ref } from 'vue';
118
+ const items = ref([
119
+ {
120
+ text: '所有城市',
121
+ children: [
122
+ {
123
+ text: '温州',
124
+ id: 1,
125
+ disabled: true
126
+ },
127
+ {
128
+ text: '杭州',
129
+ id: 2
130
+ },
131
+ {
132
+ text: '南京',
133
+ id: 3
134
+ },
135
+ {
136
+ text: '苏州',
137
+ id: 4
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ text: '浙江',
143
+ children: [
144
+ {
145
+ text: '温州',
146
+ id: 1,
147
+ disabled: true
148
+ },
149
+ {
150
+ text: '杭州',
151
+ id: 2
152
+ }
153
+ ]
154
+ },
155
+ {
156
+ text: '江苏',
157
+ children: [
158
+ {
159
+ text: '南京',
160
+ id: 3
161
+ },
162
+ {
163
+ text: '苏州',
164
+ id: 4
165
+ }
166
+ ]
167
+ }
168
+ ]);
169
+
170
+ const activeId = ref(1);
171
+ const activeIndex = ref(1);
172
+
173
+ const onNavClick = (index) => {
174
+ Toast({
175
+ message: `触发点击事件,index:${index}`
176
+ });
177
+ };
178
+
179
+ const onItemClick = (item) => {
180
+ Toast({
181
+ message: `触发点击事件,item:${JSON.stringify(item)}`
182
+ });
183
+ };
184
+
185
+ const emToastRef = ref(null);
186
+
187
+ defineExpose({
188
+ emToastRef
189
+ });
190
+ ```
191
+
192
+ ::: endif
193
+
194
+ #### 多选模式
195
+
196
+ `active-id`为数组格式时,可以选中多个右侧选项
197
+
198
+ ::: ifdef M83
199
+
200
+ ```html
201
+ <em-tree-select
202
+ :items="items"
203
+ :active-id.sync="activeIds"
204
+ :main-active-index.sync="activeIndex1"
205
+ @click-nav="onNavClick"
206
+ @click-item="onItemClick"
207
+ ></em-tree-select>
208
+ <em-toast ref="emToast"></em-toast>
209
+ ```
210
+
211
+ ```js
212
+ export default {
213
+ data() {
214
+ return {
215
+ items: [
216
+ {
217
+ text: '所有城市',
218
+ children: [
219
+ {
220
+ text: '温州',
221
+ id: 1,
222
+ disabled: true
223
+ },
224
+ {
225
+ text: '杭州',
226
+ id: 2
227
+ },
228
+ {
229
+ text: '南京',
230
+ id: 3
231
+ },
232
+ {
233
+ text: '苏州',
234
+ id: 4
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ text: '浙江',
240
+ children: [
241
+ {
242
+ text: '温州',
243
+ id: 1,
244
+ disabled: true
245
+ },
246
+ {
247
+ text: '杭州',
248
+ id: 2
249
+ }
250
+ ]
251
+ },
252
+ {
253
+ text: '江苏',
254
+ children: [
255
+ {
256
+ text: '南京',
257
+ id: 3
258
+ },
259
+ {
260
+ text: '苏州',
261
+ id: 4
262
+ }
263
+ ]
264
+ }
265
+ ],
266
+ activeIds: [2],
267
+ activeIndex1: 1
268
+ };
269
+ },
270
+ methods: {
271
+ onNavClick(index) {
272
+ Toast({
273
+ message: `触发点击事件,index:${index}`
274
+ });
275
+ },
276
+ onItemClick(item) {
277
+ Toast({
278
+ message: `触发点击事件,item:${JSON.stringify(item)}`
279
+ });
280
+ }
281
+ }
282
+ };
283
+ ```
284
+
285
+ ::: endif
286
+ ::: ifdef M84
287
+
288
+ ```html
289
+ <em-tree-select
290
+ :items="items"
291
+ :v-model:active-id="activeIds"
292
+ :v-model:main-active-index="activeIndex1"
293
+ @click-nav="onNavClick"
294
+ @click-item="onItemClick"
295
+ ></em-tree-select>
296
+ <em-toast ref="emToastRef"></em-toast>
297
+ ```
298
+
299
+ ```js
300
+ import { ref } from 'vue';
301
+ const items = ref([
302
+ {
303
+ text: '所有城市',
304
+ children: [
305
+ {
306
+ text: '温州',
307
+ id: 1,
308
+ disabled: true
309
+ },
310
+ {
311
+ text: '杭州',
312
+ id: 2
313
+ },
314
+ {
315
+ text: '南京',
316
+ id: 3
317
+ },
318
+ {
319
+ text: '苏州',
320
+ id: 4
321
+ }
322
+ ]
323
+ },
324
+ {
325
+ text: '浙江',
326
+ children: [
327
+ {
328
+ text: '温州',
329
+ id: 1,
330
+ disabled: true
331
+ },
332
+ {
333
+ text: '杭州',
334
+ id: 2
335
+ }
336
+ ]
337
+ },
338
+ {
339
+ text: '江苏',
340
+ children: [
341
+ {
342
+ text: '南京',
343
+ id: 3
344
+ },
345
+ {
346
+ text: '苏州',
347
+ id: 4
348
+ }
349
+ ]
350
+ }
351
+ ]);
352
+
353
+ const activeIds = ref([2]);
354
+ const activeIndex1 = ref(1);
355
+
356
+ const onNavClick = (index) => {
357
+ Toast({
358
+ message: `触发点击事件,index:${index}`
359
+ });
360
+ };
361
+
362
+ const onItemClick = (item) => {
363
+ Toast({
364
+ message: `触发点击事件,item:${JSON.stringify(item)}`
365
+ });
366
+ };
367
+
368
+ const emToastRef = ref(null);
369
+
370
+ defineExpose({
371
+ emToastRef
372
+ });
373
+ ```
374
+
375
+ ::: endif
376
+
377
+ #### 自定义内容
378
+
379
+ 通过`content`插槽可以自定义右侧区域的内容
380
+
381
+ ::: ifdef M83
382
+
383
+ ```html
384
+ <em-tree-select :items="items1" :main-active-index.sync="activeIndex2" @click-nav="onNavClick">
385
+ <template #content>
386
+ <em-image v-if="activeIndex2 === 0" :width="240" :height="190" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
387
+ <em-image :width="240" :height="190" v-if="activeIndex2 === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
388
+ </template>
389
+ </em-tree-select>
390
+ <em-toast ref="emToast"></em-toast>
391
+ ```
392
+
393
+ ```js
394
+ export default {
395
+ data() {
396
+ return {
397
+ activeIndex2: 1,
398
+ items1: [{ text: '分组1' }, { text: '分组2' }]
399
+ };
400
+ },
401
+ methods: {
402
+ onNavClick(index) {
403
+ Toast({
404
+ message: `触发点击事件,index:${index}`
405
+ });
406
+ }
407
+ }
408
+ };
409
+ ```
410
+
411
+ ::: endif
412
+ ::: ifdef M84
413
+
414
+ ```html
415
+ <em-tree-select :items="items1" :v-model:main-active-index="activeIndex2" @click-nav="onNavClick">
416
+ <template #content>
417
+ <em-image v-if="activeIndex2 === 0" :width="240" :height="190" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
418
+ <em-image :width="240" :height="190" v-if="activeIndex2 === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
419
+ </template>
420
+ </em-tree-select>
421
+ <em-toast ref="emToastRef"></em-toast>
422
+ ```
423
+
424
+ ```js
425
+ import { ref } from 'vue';
426
+ const items1 = ref([{ text: '分组1' }, { text: '分组2' }]);
427
+
428
+ const activeIndex2 = ref(1);
429
+
430
+ const onNavClick = (index) => {
431
+ Toast({
432
+ message: `触发点击事件,index:${index}`
433
+ });
434
+ };
435
+
436
+ const emToastRef = ref(null);
437
+
438
+ defineExpose({
439
+ emToastRef
440
+ });
441
+ ```
442
+
443
+ ::: endif
444
+
445
+ #### 徽标提示
446
+
447
+ 设置`dot`属性后,会在图标右上角展示一个小红点。设置`badge`属性后,会在图标右上角展示相应的徽标
448
+
449
+ ::: ifdef M83
450
+
451
+ ```html
452
+ <em-tree-select :items="items2" :main-active-index.sync="activeIndex3"></em-tree-select>
453
+ ```
454
+
455
+ ```js
456
+ export default {
457
+ data() {
458
+ return {
459
+ activeIndex3: 1,
460
+ items2: [
461
+ {
462
+ text: '浙江',
463
+ dot: true,
464
+ children: [
465
+ {
466
+ text: '温州',
467
+ id: 1,
468
+ disabled: true
469
+ },
470
+ {
471
+ text: '杭州',
472
+ id: 2
473
+ }
474
+ ]
475
+ },
476
+ {
477
+ text: '江苏',
478
+ badge: 5,
479
+ children: [
480
+ {
481
+ text: '南京',
482
+ id: 3
483
+ },
484
+ {
485
+ text: '苏州',
486
+ id: 4
487
+ }
488
+ ]
489
+ }
490
+ ]
491
+ };
492
+ }
493
+ };
494
+ ```
495
+
496
+ ::: endif
497
+ ::: ifdef M84
498
+
499
+ ```html
500
+ <em-tree-select :items="items2" :v-model:main-active-index="activeIndex3"></em-tree-select>
501
+ ```
502
+
503
+ ```js
504
+ import { ref } from 'vue';
505
+ const items2 = ref([
506
+ {
507
+ text: '浙江',
508
+ dot: true,
509
+ children: [
510
+ {
511
+ text: '温州',
512
+ id: 1,
513
+ disabled: true
514
+ },
515
+ {
516
+ text: '杭州',
517
+ id: 2
518
+ }
519
+ ]
520
+ },
521
+ {
522
+ text: '江苏',
523
+ badge: 5,
524
+ children: [
525
+ {
526
+ text: '南京',
527
+ id: 3
528
+ },
529
+ {
530
+ text: '苏州',
531
+ id: 4
532
+ }
533
+ ]
534
+ }
535
+ ]);
536
+
537
+ const activeIndex3 = ref(1);
538
+ ```
539
+
540
+ ::: endif
541
+
542
+ ### API
543
+
544
+ #### Props
545
+
546
+ | 参数 | 说明 | 类型 | 默认值 |
547
+ | :---------------- | :-----------------------------: | :----------------------------------- | :--------- |
548
+ | items | 分类显示所需的数据 | Item[] | `[]` |
549
+ | height | 高度,默认单位为`px` | number / string | `300` |
550
+ | main-active-index | 左侧选中项的索引 | number / string | `0` |
551
+ | active-id | 右侧选中项的 `id`,支持传入数组 | number / string /(number / string)[] | `0` |
552
+ | max | 右侧项最大选中个数 | number / string | `Infinity` |
553
+ | selected-icon | 自定义右侧栏选中状态的图标 | string | `success` |
554
+
555
+ #### Slots
556
+
557
+ | 名称 | 说明 |
558
+ | :------ | :----------------: |
559
+ | content | 自定义右侧区域内容 |
560
+
561
+ #### Events
562
+
563
+ | 事件名 | 说明 | 回调参数 |
564
+ | :--------- | :------------------: | :------------------------ |
565
+ | click-nav | 点击左侧导航时触发 | index:被点击的导航的索引 |
566
+ | click-item | 点击右侧选择项时触发 | data: 该点击项的数据 |
567
+
568
+ #### Item 数据结构
569
+
570
+ `items` 整体为一个数组,数组内包含一系列描述分类的对象,每个分类里,`text`表示当前分类的名称,`children`表示分类里的可选项。
571
+
572
+ ```js
573
+ [
574
+ {
575
+ // 导航名称
576
+ text: '所有城市',
577
+ // 导航名称右上角徽标,2.5.6 版本开始支持
578
+ badge: 3,
579
+ // 是否在导航名称右上角显示小红点
580
+ dot: true,
581
+ // 导航节点额外类名
582
+ className: 'my-class',
583
+ // 该导航下所有的可选项
584
+ children: [
585
+ {
586
+ // 名称
587
+ text: '温州',
588
+ // id,作为匹配选中状态的标识符
589
+ id: 1,
590
+ // 禁用选项
591
+ disabled: true
592
+ },
593
+ {
594
+ text: '杭州',
595
+ id: 2
596
+ }
597
+ ]
598
+ }
599
+ ];
600
+ ```
601
+
602
+ ::: ifdef M83
603
+ <iframe
604
+ src="//app.epoint.com.cn/m8mpdoc/showcase/index.html#/modules/m8showcase/examples/em-tree-select"
605
+ frameborder=0
606
+ allowfullscreen class="ui-showcase-iframe">
607
+ </iframe>
608
+ ::: endif
609
+ ::: ifdef M84
610
+ <iframe
611
+ src="//app.epoint.com.cn/m8mpdoc/showcase/m8.4/index.html#/modules/m8showcase/examples/em-tree-select"
612
+ frameborder=0
613
+ allowfullscreen class="ui-showcase-iframe">
614
+ </iframe>
615
+ ::: endif
616
+
617
+ <style>
618
+ .ui-showcase-iframe {
619
+ position: fixed;
620
+ right: 3.5vw;
621
+ top: 17%;
622
+ width: 375px;
623
+ height: 75vh;
624
+ box-shadow: 0 0 12px 6px #eee;
625
+ border-radius: 15px;
626
+ }
627
+ .main .markdown-body {
628
+ padding: 45px;
629
+ width: calc(97vw - 661px);
630
+ }
631
+ </style>