pit-docs-mcp 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +180 -0
  2. package/dist/codegen.d.ts +5 -0
  3. package/dist/codegen.d.ts.map +1 -0
  4. package/dist/codegen.js +112 -0
  5. package/dist/constants.d.ts +6 -0
  6. package/dist/constants.d.ts.map +1 -0
  7. package/dist/constants.js +10 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +115 -0
  11. package/dist/resources.d.ts +3 -0
  12. package/dist/resources.d.ts.map +1 -0
  13. package/dist/resources.js +80 -0
  14. package/dist/tools.d.ts +3 -0
  15. package/dist/tools.d.ts.map +1 -0
  16. package/dist/tools.js +258 -0
  17. package/dist/utils.d.ts +26 -0
  18. package/dist/utils.d.ts.map +1 -0
  19. package/dist/utils.js +198 -0
  20. package/docs/codegen/pit-simplify-web.md +686 -0
  21. package/docs/pitBusinessUi/README.md +102 -0
  22. package/docs/pitBusinessUi/add-date-picker.md +57 -0
  23. package/docs/pitBusinessUi/add-operation.md +64 -0
  24. package/docs/pitBusinessUi/batch-download.md +44 -0
  25. package/docs/pitBusinessUi/bill-tree-dialog.md +82 -0
  26. package/docs/pitBusinessUi/collapse.md +88 -0
  27. package/docs/pitBusinessUi/date-time-picker.md +74 -0
  28. package/docs/pitBusinessUi/design-report-explain.md +47 -0
  29. package/docs/pitBusinessUi/dialog.md +89 -0
  30. package/docs/pitBusinessUi/dic-radio.md +67 -0
  31. package/docs/pitBusinessUi/dic.md +78 -0
  32. package/docs/pitBusinessUi/document-preview.md +54 -0
  33. package/docs/pitBusinessUi/drawer.md +67 -0
  34. package/docs/pitBusinessUi/editor.md +63 -0
  35. package/docs/pitBusinessUi/expand-search-form.md +65 -0
  36. package/docs/pitBusinessUi/file-preview.md +56 -0
  37. package/docs/pitBusinessUi/flow-table-status.md +47 -0
  38. package/docs/pitBusinessUi/icon-box.md +74 -0
  39. package/docs/pitBusinessUi/image-preview.md +55 -0
  40. package/docs/pitBusinessUi/image.md +53 -0
  41. package/docs/pitBusinessUi/input-formatter.md +100 -0
  42. package/docs/pitBusinessUi/input-number.md +47 -0
  43. package/docs/pitBusinessUi/input-select.md +68 -0
  44. package/docs/pitBusinessUi/input.md +56 -0
  45. package/docs/pitBusinessUi/jm-preview.md +47 -0
  46. package/docs/pitBusinessUi/json-editor.md +71 -0
  47. package/docs/pitBusinessUi/loading-btn.md +64 -0
  48. package/docs/pitBusinessUi/monaco.md +82 -0
  49. package/docs/pitBusinessUi/money-input.md +59 -0
  50. package/docs/pitBusinessUi/pagination.md +70 -0
  51. package/docs/pitBusinessUi/password-strength.md +59 -0
  52. package/docs/pitBusinessUi/positive-number.md +63 -0
  53. package/docs/pitBusinessUi/preview-image.md +62 -0
  54. package/docs/pitBusinessUi/preview-office.md +50 -0
  55. package/docs/pitBusinessUi/preview.md +57 -0
  56. package/docs/pitBusinessUi/quill.md +52 -0
  57. package/docs/pitBusinessUi/runflow-btn.md +52 -0
  58. package/docs/pitBusinessUi/search-date-picker.md +60 -0
  59. package/docs/pitBusinessUi/select-bid-list.md +66 -0
  60. package/docs/pitBusinessUi/select-color.md +38 -0
  61. package/docs/pitBusinessUi/select-contract-tree.md +41 -0
  62. package/docs/pitBusinessUi/select-dept.md +38 -0
  63. package/docs/pitBusinessUi/select-project-unit.md +48 -0
  64. package/docs/pitBusinessUi/select-section-tree.md +45 -0
  65. package/docs/pitBusinessUi/select-section.md +66 -0
  66. package/docs/pitBusinessUi/select-string.md +60 -0
  67. package/docs/pitBusinessUi/select-system-unit.md +41 -0
  68. package/docs/pitBusinessUi/select-user-by-role.md +51 -0
  69. package/docs/pitBusinessUi/switch.md +43 -0
  70. package/docs/pitBusinessUi/table-contract.md +66 -0
  71. package/docs/pitBusinessUi/table-operation.md +81 -0
  72. package/docs/pitBusinessUi/table.md +75 -0
  73. package/docs/pitBusinessUi/tag.md +86 -0
  74. package/docs/pitBusinessUi/textarea.md +65 -0
  75. package/docs/pitBusinessUi/transfer-direct.md +57 -0
  76. package/docs/pitBusinessUi/transfer-user-project.md +78 -0
  77. package/docs/pitBusinessUi/transfer.md +68 -0
  78. package/docs/pitBusinessUi/tree-lazy.md +72 -0
  79. package/docs/pitBusinessUi/tree-select-name.md +59 -0
  80. package/docs/pitBusinessUi/tree-select-plus.md +106 -0
  81. package/docs/pitBusinessUi/tree-select.md +86 -0
  82. package/docs/pitBusinessUi/upload-avatar.md +60 -0
  83. package/docs/pitBusinessUi/upload-file-dialog.md +86 -0
  84. package/docs/pitBusinessUi/upload-file.md +77 -0
  85. package/docs/pitBusinessUi/upload-list-card.md +62 -0
  86. package/docs/pitBusinessUi/upload-table.md +77 -0
  87. package/docs/pitBusinessUi/user-transform.md +72 -0
  88. package/docs/pitBusinessUi/utils.md +272 -0
  89. package/docs/pitBusinessUtils/README.md +144 -0
  90. package/docs/pitBusinessUtils/auth.md +170 -0
  91. package/docs/pitBusinessUtils/clipboard.md +72 -0
  92. package/docs/pitBusinessUtils/filePreview.md +60 -0
  93. package/docs/pitBusinessUtils/formValidate.md +75 -0
  94. package/docs/pitBusinessUtils/generateTitle.md +49 -0
  95. package/docs/pitBusinessUtils/get-page-title.md +65 -0
  96. package/docs/pitBusinessUtils/i18n.md +130 -0
  97. package/docs/pitBusinessUtils/jwks.md +82 -0
  98. package/docs/pitBusinessUtils/oss.md +391 -0
  99. package/docs/pitBusinessUtils/passwordValidate.md +120 -0
  100. package/docs/pitBusinessUtils/pit.md +496 -0
  101. package/docs/pitBusinessUtils/print.md +126 -0
  102. package/docs/pitBusinessUtils/request.md +137 -0
  103. package/docs/pitBusinessUtils/scroll-to.md +68 -0
  104. package/docs/pitBusinessUtils/utils.md +762 -0
  105. package/docs/pitBusinessUtils/validate.md +224 -0
  106. package/docs/pitElementUi/alert.md +238 -0
  107. package/docs/pitElementUi/avatar.md +147 -0
  108. package/docs/pitElementUi/backtop.md +60 -0
  109. package/docs/pitElementUi/badge.md +120 -0
  110. package/docs/pitElementUi/base-tabs.md +73 -0
  111. package/docs/pitElementUi/border.md +135 -0
  112. package/docs/pitElementUi/breadcrumb.md +44 -0
  113. package/docs/pitElementUi/button.md +301 -0
  114. package/docs/pitElementUi/calendar.md +66 -0
  115. package/docs/pitElementUi/card.md +170 -0
  116. package/docs/pitElementUi/carousel.md +212 -0
  117. package/docs/pitElementUi/cascader.md +1966 -0
  118. package/docs/pitElementUi/checkbox.md +283 -0
  119. package/docs/pitElementUi/collapse.md +131 -0
  120. package/docs/pitElementUi/color-picker.md +123 -0
  121. package/docs/pitElementUi/color.md +244 -0
  122. package/docs/pitElementUi/container.md +240 -0
  123. package/docs/pitElementUi/custom-theme.md +131 -0
  124. package/docs/pitElementUi/date-picker.md +448 -0
  125. package/docs/pitElementUi/datetime-picker.md +254 -0
  126. package/docs/pitElementUi/descriptions.md +191 -0
  127. package/docs/pitElementUi/dialog-header.md +53 -0
  128. package/docs/pitElementUi/dialog.md +239 -0
  129. package/docs/pitElementUi/divider.md +61 -0
  130. package/docs/pitElementUi/drawer.md +307 -0
  131. package/docs/pitElementUi/dropdown.md +308 -0
  132. package/docs/pitElementUi/empty.md +61 -0
  133. package/docs/pitElementUi/font-family.md +90 -0
  134. package/docs/pitElementUi/form-base.md +1239 -0
  135. package/docs/pitElementUi/form-item-checkbox-group.md +48 -0
  136. package/docs/pitElementUi/form-item-date.md +60 -0
  137. package/docs/pitElementUi/form-item-dic.md +18 -0
  138. package/docs/pitElementUi/form-item-editor.md +16 -0
  139. package/docs/pitElementUi/form-item-input-money.md +19 -0
  140. package/docs/pitElementUi/form-item-input-number.md +20 -0
  141. package/docs/pitElementUi/form-item-input.md +18 -0
  142. package/docs/pitElementUi/form-item-radio-group.md +21 -0
  143. package/docs/pitElementUi/form-item-select.md +21 -0
  144. package/docs/pitElementUi/form-item-switch.md +15 -0
  145. package/docs/pitElementUi/form-item-textarea.md +20 -0
  146. package/docs/pitElementUi/form-item-tree-select.md +27 -0
  147. package/docs/pitElementUi/form-item-upload-card.md +18 -0
  148. package/docs/pitElementUi/form-item-upload.md +1 -0
  149. package/docs/pitElementUi/form-two.md +102 -0
  150. package/docs/pitElementUi/form.md +952 -0
  151. package/docs/pitElementUi/i18n.md +228 -0
  152. package/docs/pitElementUi/icon-custom.md +99 -0
  153. package/docs/pitElementUi/icon-line-custom.md +12 -0
  154. package/docs/pitElementUi/icon.md +28 -0
  155. package/docs/pitElementUi/image.md +178 -0
  156. package/docs/pitElementUi/infiniteScroll.md +87 -0
  157. package/docs/pitElementUi/input-number.md +197 -0
  158. package/docs/pitElementUi/input-select.md +1 -0
  159. package/docs/pitElementUi/input.md +800 -0
  160. package/docs/pitElementUi/installation.md +9 -0
  161. package/docs/pitElementUi/layout-column.md +376 -0
  162. package/docs/pitElementUi/layout-tree.md +715 -0
  163. package/docs/pitElementUi/layout.md +354 -0
  164. package/docs/pitElementUi/link.md +66 -0
  165. package/docs/pitElementUi/loading.md +208 -0
  166. package/docs/pitElementUi/menu.md +403 -0
  167. package/docs/pitElementUi/message-box.md +326 -0
  168. package/docs/pitElementUi/message.md +219 -0
  169. package/docs/pitElementUi/notification.md +311 -0
  170. package/docs/pitElementUi/page-header.md +40 -0
  171. package/docs/pitElementUi/pagination.md +200 -0
  172. package/docs/pitElementUi/popconfirm.md +60 -0
  173. package/docs/pitElementUi/popover.md +167 -0
  174. package/docs/pitElementUi/progress.md +178 -0
  175. package/docs/pitElementUi/quickstart.md +290 -0
  176. package/docs/pitElementUi/radio.md +211 -0
  177. package/docs/pitElementUi/rate.md +135 -0
  178. package/docs/pitElementUi/result.md +76 -0
  179. package/docs/pitElementUi/select-tree.md +661 -0
  180. package/docs/pitElementUi/select.md +586 -0
  181. package/docs/pitElementUi/skeleton.md +316 -0
  182. package/docs/pitElementUi/slider.md +237 -0
  183. package/docs/pitElementUi/steps.md +154 -0
  184. package/docs/pitElementUi/switch.md +142 -0
  185. package/docs/pitElementUi/table.md +4023 -0
  186. package/docs/pitElementUi/tabs.md +303 -0
  187. package/docs/pitElementUi/tag.md +203 -0
  188. package/docs/pitElementUi/time-picker.md +199 -0
  189. package/docs/pitElementUi/timeline.md +154 -0
  190. package/docs/pitElementUi/tooltip.md +177 -0
  191. package/docs/pitElementUi/transfer.md +249 -0
  192. package/docs/pitElementUi/transition.md +155 -0
  193. package/docs/pitElementUi/tree.md +1157 -0
  194. package/docs/pitElementUi/typography.md +151 -0
  195. package/docs/pitElementUi/upload-table.md +39 -0
  196. package/docs/pitElementUi/upload.md +392 -0
  197. package/docs/pitElementUi/virtual-list.md +154 -0
  198. package/docs/pitElementUi/virtual-select-tree.md +243 -0
  199. package/docs/pitElementUi/virtual-select.md +451 -0
  200. package/docs/pitElementUi/virtual-table-column.md +1 -0
  201. package/docs/pitElementUi/virtual-table.md +490 -0
  202. package/docs/pitElementUi/virtual-tree.md +119 -0
  203. package/package.json +33 -0
@@ -0,0 +1,303 @@
1
+ ## Tabs 标签页
2
+
3
+ 分隔内容上有关联但属于不同类别的数据集合。
4
+
5
+ ### 基础用法
6
+
7
+ 基础的、简洁的标签页。
8
+
9
+ :::demo Tabs 组件提供了选项卡功能,默认选中第一个标签页,你也可以通过 `value` 属性来指定当前选中的标签页。
10
+
11
+ ```html
12
+ <template>
13
+ <el-tabs v-model="activeName" @tab-click="handleClick">
14
+ <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
15
+ <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
16
+ <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
17
+ <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
18
+ </el-tabs>
19
+ </template>
20
+ <script>
21
+ export default {
22
+ data() {
23
+ return {
24
+ activeName: 'second'
25
+ };
26
+ },
27
+ methods: {
28
+ handleClick(tab, event) {
29
+ console.log(tab, event);
30
+ }
31
+ }
32
+ };
33
+ </script>
34
+ ```
35
+ :::
36
+
37
+ ### 选项卡样式
38
+
39
+ 选项卡样式的标签页。
40
+
41
+ :::demo 只需要设置 `type` 属性为 `card` 就可以使选项卡改变为标签风格。
42
+
43
+ ```html
44
+ <template>
45
+ <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
46
+ <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
47
+ <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
48
+ <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
49
+ <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
50
+ </el-tabs>
51
+ </template>
52
+ <script>
53
+ export default {
54
+ data() {
55
+ return {
56
+ activeName: 'first'
57
+ };
58
+ },
59
+ methods: {
60
+ handleClick(tab, event) {
61
+ console.log(tab, event);
62
+ }
63
+ }
64
+ };
65
+ </script>
66
+ ```
67
+ :::
68
+
69
+ ### 卡片化
70
+
71
+ 卡片化的标签页。
72
+
73
+ :::demo 将`type`设置为`border-card`。
74
+ ```html
75
+ <el-tabs type="border-card">
76
+ <el-tab-pane label="用户管理">用户管理</el-tab-pane>
77
+ <el-tab-pane label="配置管理">配置管理</el-tab-pane>
78
+ <el-tab-pane label="角色管理">角色管理</el-tab-pane>
79
+ <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
80
+ </el-tabs>
81
+ ```
82
+ :::
83
+
84
+ ### 位置
85
+
86
+ 可以通过 `tab-position` 设置标签的位置
87
+
88
+ :::demo 标签一共有四个方向的设置 `tabPosition="left|right|top|bottom"`
89
+
90
+ ```html
91
+ <template>
92
+ <el-radio-group v-model="tabPosition" style="margin-bottom: 30px;">
93
+ <el-radio-button label="top">top</el-radio-button>
94
+ <el-radio-button label="right">right</el-radio-button>
95
+ <el-radio-button label="bottom">bottom</el-radio-button>
96
+ <el-radio-button label="left">left</el-radio-button>
97
+ </el-radio-group>
98
+
99
+ <el-tabs :tab-position="tabPosition" style="height: 200px;">
100
+ <el-tab-pane label="用户管理">用户管理</el-tab-pane>
101
+ <el-tab-pane label="配置管理">配置管理</el-tab-pane>
102
+ <el-tab-pane label="角色管理">角色管理</el-tab-pane>
103
+ <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
104
+ </el-tabs>
105
+ </template>
106
+ <script>
107
+ export default {
108
+ data() {
109
+ return {
110
+ tabPosition: 'left'
111
+ };
112
+ }
113
+ };
114
+ </script>
115
+ ```
116
+ :::
117
+
118
+ ### 自定义标签页
119
+
120
+ 可以通过具名 `slot` 来实现自定义标签页的内容
121
+
122
+ :::demo
123
+ ```html
124
+ <el-tabs type="border-card">
125
+ <el-tab-pane>
126
+ <span slot="label"><i class="el-icon-date"></i> 我的行程</span>
127
+ 我的行程
128
+ </el-tab-pane>
129
+ <el-tab-pane label="消息中心">消息中心</el-tab-pane>
130
+ <el-tab-pane label="角色管理">角色管理</el-tab-pane>
131
+ <el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane>
132
+ </el-tabs>
133
+ ```
134
+ :::
135
+
136
+ ### 动态增减标签页
137
+
138
+ 增减标签页按钮只能在选项卡样式的标签页下使用
139
+
140
+ :::demo
141
+ ```html
142
+ <el-tabs v-model="editableTabsValue" type="card" editable @edit="handleTabsEdit">
143
+ <el-tab-pane
144
+ :key="item.name"
145
+ v-for="(item, index) in editableTabs"
146
+ :label="item.title"
147
+ :name="item.name"
148
+ >
149
+ {{item.content}}
150
+ </el-tab-pane>
151
+ </el-tabs>
152
+ <script>
153
+ export default {
154
+ data() {
155
+ return {
156
+ editableTabsValue: '2',
157
+ editableTabs: [{
158
+ title: 'Tab 1',
159
+ name: '1',
160
+ content: 'Tab 1 content'
161
+ }, {
162
+ title: 'Tab 2',
163
+ name: '2',
164
+ content: 'Tab 2 content'
165
+ }],
166
+ tabIndex: 2
167
+ }
168
+ },
169
+ methods: {
170
+ handleTabsEdit(targetName, action) {
171
+ if (action === 'add') {
172
+ let newTabName = ++this.tabIndex + '';
173
+ this.editableTabs.push({
174
+ title: 'New Tab',
175
+ name: newTabName,
176
+ content: 'New Tab content'
177
+ });
178
+ this.editableTabsValue = newTabName;
179
+ }
180
+ if (action === 'remove') {
181
+ let tabs = this.editableTabs;
182
+ let activeName = this.editableTabsValue;
183
+ if (activeName === targetName) {
184
+ tabs.forEach((tab, index) => {
185
+ if (tab.name === targetName) {
186
+ let nextTab = tabs[index + 1] || tabs[index - 1];
187
+ if (nextTab) {
188
+ activeName = nextTab.name;
189
+ }
190
+ }
191
+ });
192
+ }
193
+
194
+ this.editableTabsValue = activeName;
195
+ this.editableTabs = tabs.filter(tab => tab.name !== targetName);
196
+ }
197
+ }
198
+ }
199
+ }
200
+ </script>
201
+ ```
202
+ :::
203
+
204
+ ### 自定义增加标签页触发器
205
+
206
+ :::demo
207
+ ```html
208
+ <div style="margin-bottom: 20px;">
209
+ <el-button
210
+ size="small"
211
+ @click="addTab(editableTabsValue)"
212
+ >
213
+ add tab
214
+ </el-button>
215
+ </div>
216
+ <el-tabs v-model="editableTabsValue" type="card" closable @tab-remove="removeTab">
217
+ <el-tab-pane
218
+ v-for="(item, index) in editableTabs"
219
+ :key="item.name"
220
+ :label="item.title"
221
+ :name="item.name"
222
+ >
223
+ {{item.content}}
224
+ </el-tab-pane>
225
+ </el-tabs>
226
+ <script>
227
+ export default {
228
+ data() {
229
+ return {
230
+ editableTabsValue: '2',
231
+ editableTabs: [{
232
+ title: 'Tab 1',
233
+ name: '1',
234
+ content: 'Tab 1 content'
235
+ }, {
236
+ title: 'Tab 2',
237
+ name: '2',
238
+ content: 'Tab 2 content'
239
+ }],
240
+ tabIndex: 2
241
+ }
242
+ },
243
+ methods: {
244
+ addTab(targetName) {
245
+ let newTabName = ++this.tabIndex + '';
246
+ this.editableTabs.push({
247
+ title: 'New Tab',
248
+ name: newTabName,
249
+ content: 'New Tab content'
250
+ });
251
+ this.editableTabsValue = newTabName;
252
+ },
253
+ removeTab(targetName) {
254
+ let tabs = this.editableTabs;
255
+ let activeName = this.editableTabsValue;
256
+ if (activeName === targetName) {
257
+ tabs.forEach((tab, index) => {
258
+ if (tab.name === targetName) {
259
+ let nextTab = tabs[index + 1] || tabs[index - 1];
260
+ if (nextTab) {
261
+ activeName = nextTab.name;
262
+ }
263
+ }
264
+ });
265
+ }
266
+
267
+ this.editableTabsValue = activeName;
268
+ this.editableTabs = tabs.filter(tab => tab.name !== targetName);
269
+ }
270
+ }
271
+ }
272
+ </script>
273
+ ```
274
+ :::
275
+
276
+ ### Tabs Attributes
277
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
278
+ |---------- |-------- |---------- |------------- |-------- |
279
+ | value / v-model | 绑定值,选中选项卡的 name | string | — | 第一个选项卡的 name |
280
+ | type | 风格类型 | string | card/border-card | — |
281
+ | closable | 标签是否可关闭 | boolean | — | false |
282
+ | addable | 标签是否可增加 | boolean | — | false |
283
+ | editable | 标签是否同时可增加和关闭 | boolean | — | false |
284
+ | tab-position | 选项卡所在位置 | string | top/right/bottom/left | top |
285
+ | stretch | 标签的宽度是否自撑开 | boolean | - | false |
286
+ | before-leave | 切换标签之前的钩子,若返回 false 或者返回 Promise 且被 reject,则阻止切换。 | Function(activeName, oldActiveName) | — | — |
287
+
288
+ ### Tabs Events
289
+ | 事件名称 | 说明 | 回调参数 |
290
+ |---------- |-------- |---------- |
291
+ | tab-click | tab 被选中时触发 | 被选中的标签 tab 实例 |
292
+ | tab-remove | 点击 tab 移除按钮后触发 | 被删除的标签的 name |
293
+ | tab-add | 点击 tabs 的新增按钮后触发 | — |
294
+ | edit | 点击 tabs 的新增按钮或 tab 被关闭后触发 | (targetName, action) |
295
+
296
+ ### Tab-pane Attributes
297
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
298
+ |---------- |-------- |---------- |------------- |-------- |
299
+ | label | 选项卡标题 | string | — | — |
300
+ | disabled | 是否禁用 | boolean | — | false |
301
+ | name | 与选项卡绑定值 value 对应的标识符,表示选项卡别名 | string | — | 该选项卡在选项卡列表中的顺序值,如第一个选项卡则为'1' |
302
+ | closable | 标签是否可关闭 | boolean | — | false |
303
+ | lazy | 标签是否延迟渲染 | boolean | — | false |
@@ -0,0 +1,203 @@
1
+ ## Tag 标签
2
+
3
+ 用于标记和选择。
4
+
5
+ ### 基础用法
6
+
7
+ :::demo 由`type`属性来选择tag的类型,也可以通过`color`属性来自定义背景色。
8
+
9
+ ```html
10
+ <el-tag>标签一</el-tag>
11
+ <el-tag type="success">标签二</el-tag>
12
+ <el-tag type="info">标签三</el-tag>
13
+ <el-tag type="warning">标签四</el-tag>
14
+ <el-tag type="danger">标签五</el-tag>
15
+ ```
16
+ :::
17
+
18
+ ### 可移除标签
19
+
20
+ :::demo 设置`closable`属性可以定义一个标签是否可移除。默认的标签移除时会附带渐变动画,如果不想使用,可以设置`disable-transitions`属性,它接受一个`Boolean`,true 为关闭。
21
+
22
+ ```html
23
+ <el-tag
24
+ v-for="tag in tags"
25
+ :key="tag.name"
26
+ closable
27
+ :type="tag.type">
28
+ {{tag.name}}
29
+ </el-tag>
30
+
31
+ <script>
32
+ export default {
33
+ data() {
34
+ return {
35
+ tags: [
36
+ { name: '标签一', type: '' },
37
+ { name: '标签二', type: 'success' },
38
+ { name: '标签三', type: 'info' },
39
+ { name: '标签四', type: 'warning' },
40
+ { name: '标签五', type: 'danger' }
41
+ ]
42
+ };
43
+ }
44
+ }
45
+ </script>
46
+ ```
47
+ :::
48
+
49
+ ### 动态编辑标签
50
+
51
+ 动态编辑标签可以通过点击标签关闭按钮后触发的 `close` 事件来实现
52
+
53
+ :::demo
54
+ ```html
55
+ <el-tag
56
+ :key="tag"
57
+ v-for="tag in dynamicTags"
58
+ closable
59
+ :disable-transitions="false"
60
+ @close="handleClose(tag)">
61
+ {{tag}}
62
+ </el-tag>
63
+ <el-input
64
+ class="input-new-tag"
65
+ v-if="inputVisible"
66
+ v-model="inputValue"
67
+ ref="saveTagInput"
68
+ size="small"
69
+ @keyup.enter.native="handleInputConfirm"
70
+ @blur="handleInputConfirm"
71
+ >
72
+ </el-input>
73
+ <el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
74
+
75
+ <style>
76
+ .el-tag + .el-tag {
77
+ margin-left: 10px;
78
+ }
79
+ .button-new-tag {
80
+ margin-left: 10px;
81
+ height: 32px;
82
+ line-height: 30px;
83
+ padding-top: 0;
84
+ padding-bottom: 0;
85
+ }
86
+ .input-new-tag {
87
+ width: 90px;
88
+ margin-left: 10px;
89
+ vertical-align: bottom;
90
+ }
91
+ </style>
92
+
93
+ <script>
94
+ export default {
95
+ data() {
96
+ return {
97
+ dynamicTags: ['标签一', '标签二', '标签三'],
98
+ inputVisible: false,
99
+ inputValue: ''
100
+ };
101
+ },
102
+ methods: {
103
+ handleClose(tag) {
104
+ this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
105
+ },
106
+
107
+ showInput() {
108
+ this.inputVisible = true;
109
+ this.$nextTick(_ => {
110
+ this.$refs.saveTagInput.$refs.input.focus();
111
+ });
112
+ },
113
+
114
+ handleInputConfirm() {
115
+ let inputValue = this.inputValue;
116
+ if (inputValue) {
117
+ this.dynamicTags.push(inputValue);
118
+ }
119
+ this.inputVisible = false;
120
+ this.inputValue = '';
121
+ }
122
+ }
123
+ }
124
+ </script>
125
+ ```
126
+ :::
127
+
128
+ ### 不同尺寸
129
+
130
+ Tag 组件提供除了默认值以外的三种尺寸,可以在不同场景下选择合适的按钮尺寸。
131
+
132
+ :::demo 额外的尺寸:`medium`、`small`、`mini`,通过设置`size`属性来配置它们。
133
+
134
+ ```html
135
+ <el-tag closable>默认标签</el-tag>
136
+ <el-tag size="medium" closable>中等标签</el-tag>
137
+ <el-tag size="small" closable>小型标签</el-tag>
138
+ <el-tag size="mini" closable>超小标签</el-tag>
139
+ ```
140
+ :::
141
+
142
+ ### 不同主题
143
+
144
+ Tag 组件提供了三个不同的主题:`dark`、`light` 和 `plain`
145
+
146
+ :::demo 通过设置`effect`属性来改变主题,默认为 `light`
147
+ ```html
148
+ <div class="tag-group">
149
+ <span class="tag-group__title">Dark</span>
150
+ <el-tag
151
+ v-for="item in items"
152
+ :key="item.label"
153
+ :type="item.type"
154
+ effect="dark">
155
+ {{ item.label }}
156
+ </el-tag>
157
+ </div>
158
+ <div class="tag-group">
159
+ <span class="tag-group__title">Plain</span>
160
+ <el-tag
161
+ v-for="item in items"
162
+ :key="item.label"
163
+ :type="item.type"
164
+ effect="plain">
165
+ {{ item.label }}
166
+ </el-tag>
167
+ </div>
168
+
169
+ <script>
170
+ export default {
171
+ data() {
172
+ return {
173
+ items: [
174
+ { type: '', label: '标签一' },
175
+ { type: 'success', label: '标签二' },
176
+ { type: 'info', label: '标签三' },
177
+ { type: 'danger', label: '标签四' },
178
+ { type: 'warning', label: '标签五' }
179
+ ]
180
+ }
181
+ }
182
+ }
183
+ </script>
184
+ ```
185
+ :::
186
+
187
+ ### Attributes
188
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
189
+ |---------- |-------------- |---------- |-------------------------------- |-------- |
190
+ | type | 类型 | string | success/info/warning/danger | — |
191
+ | closable | 是否可关闭 | boolean | — | false |
192
+ | disable-transitions | 是否禁用渐变动画 | boolean | — | false |
193
+ | hit | 是否有边框描边 | boolean | — | false |
194
+ | color | 背景色 | string | — | — |
195
+ | size | 尺寸 | string | medium / small / mini | — |
196
+ | effect | 主题 | string | dark / light / plain | light |
197
+
198
+
199
+ ### Events
200
+ | 事件名称 | 说明 | 回调参数 |
201
+ |---------- |-------- |---------- |
202
+ | click | 点击 Tag 时触发的事件 | — |
203
+ | close | 关闭 Tag 时触发的事件 | — |
@@ -0,0 +1,199 @@
1
+ ## TimePicker 时间选择器
2
+
3
+ 用于选择或输入日期
4
+
5
+ ### 固定时间点
6
+
7
+ 提供几个固定的时间点供用户选择
8
+
9
+ :::demo 使用 el-time-select 标签,分别通过`start`、`end`和`step`指定可选的起始时间、结束时间和步长
10
+ ```html
11
+ <el-time-select
12
+ v-model="value"
13
+ :picker-options="{
14
+ start: '08:30',
15
+ step: '00:15',
16
+ end: '18:30'
17
+ }"
18
+ placeholder="选择时间">
19
+ </el-time-select>
20
+
21
+ <script>
22
+ export default {
23
+ data() {
24
+ return {
25
+ value: ''
26
+ };
27
+ }
28
+ }
29
+ </script>
30
+ ```
31
+ :::
32
+
33
+ ### 任意时间点
34
+
35
+ 可以选择任意时间
36
+
37
+ :::demo 使用 el-time-picker 标签,通过`selectableRange`限制可选时间范围。提供了两种交互方式:默认情况下通过鼠标滚轮进行选择,打开`arrow-control`属性则通过界面上的箭头进行选择。
38
+ ```html
39
+ <template>
40
+ <el-time-picker
41
+ v-model="value1"
42
+ :picker-options="{
43
+ selectableRange: '18:30:00 - 20:30:00'
44
+ }"
45
+ placeholder="任意时间点">
46
+ </el-time-picker>
47
+ <el-time-picker
48
+ arrow-control
49
+ v-model="value2"
50
+ :picker-options="{
51
+ selectableRange: '18:30:00 - 20:30:00'
52
+ }"
53
+ placeholder="任意时间点">
54
+ </el-time-picker>
55
+ </template>
56
+
57
+ <script>
58
+ export default {
59
+ data() {
60
+ return {
61
+ value1: new Date(2016, 9, 10, 18, 40),
62
+ value2: new Date(2016, 9, 10, 18, 40)
63
+ };
64
+ }
65
+ }
66
+ </script>
67
+ ```
68
+ :::
69
+
70
+ ### 固定时间范围
71
+
72
+ 若先选择开始时间,则结束时间内备选项的状态会随之改变
73
+
74
+ :::demo
75
+ ```html
76
+ <template>
77
+ <el-time-select
78
+ placeholder="起始时间"
79
+ v-model="startTime"
80
+ :picker-options="{
81
+ start: '08:30',
82
+ step: '00:15',
83
+ end: '18:30'
84
+ }">
85
+ </el-time-select>
86
+ <el-time-select
87
+ placeholder="结束时间"
88
+ v-model="endTime"
89
+ :picker-options="{
90
+ start: '08:30',
91
+ step: '00:15',
92
+ end: '18:30',
93
+ minTime: startTime
94
+ }">
95
+ </el-time-select>
96
+ </template>
97
+
98
+ <script>
99
+ export default {
100
+ data() {
101
+ return {
102
+ startTime: '',
103
+ endTime: ''
104
+ };
105
+ }
106
+ }
107
+ </script>
108
+ ```
109
+ :::
110
+
111
+ ### 任意时间范围
112
+
113
+ 可选择任意的时间范围
114
+
115
+ :::demo 添加`is-range`属性即可选择时间范围,同样支持`arrow-control`属性。
116
+ ```html
117
+ <template>
118
+ <el-time-picker
119
+ is-range
120
+ v-model="value1"
121
+ range-separator="至"
122
+ start-placeholder="开始时间"
123
+ end-placeholder="结束时间"
124
+ placeholder="选择时间范围">
125
+ </el-time-picker>
126
+ <el-time-picker
127
+ is-range
128
+ arrow-control
129
+ v-model="value2"
130
+ range-separator="至"
131
+ start-placeholder="开始时间"
132
+ end-placeholder="结束时间"
133
+ placeholder="选择时间范围">
134
+ </el-time-picker>
135
+ </template>
136
+
137
+ <script>
138
+ export default {
139
+ data() {
140
+ return {
141
+ value1: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
142
+ value2: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)]
143
+ };
144
+ }
145
+ }
146
+ </script>
147
+ ```
148
+ :::
149
+
150
+ ### Attributes
151
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
152
+ |---------- |-------------- |---------- |-------------------------------- |-------- |
153
+ | value / v-model | 绑定值 | date(TimePicker) / string(TimeSelect) | — | — |
154
+ | readonly | 完全只读 | boolean | — | false |
155
+ | disabled | 禁用 | boolean | — | false |
156
+ | editable | 文本框可输入 | boolean | — | true |
157
+ | clearable | 是否显示清除按钮 | boolean | — | true |
158
+ | size | 输入框尺寸 | string | medium / small / mini | — |
159
+ | placeholder | 非范围选择时的占位内容 | string | — | — |
160
+ | start-placeholder | 范围选择时开始日期的占位内容 | string | — | — |
161
+ | end-placeholder | 范围选择时开始日期的占位内容 | string | — | — |
162
+ | is-range | 是否为时间范围选择,仅对`<el-time-picker>`有效 | boolean | — | false |
163
+ | arrow-control | 是否使用箭头进行时间选择,仅对`<el-time-picker>`有效 | boolean | — | false |
164
+ | align | 对齐方式 | string | left / center / right | left |
165
+ | popper-class | TimePicker 下拉框的类名 | string | — | — |
166
+ | picker-options | 当前时间日期选择器特有的选项参考下表 | object | — | {} |
167
+ | range-separator | 选择范围时的分隔符 | string | - | '-' |
168
+ | value-format | 可选,仅TimePicker时可用,绑定值的格式。不指定则绑定值为 Date 对象 | string | 见[日期格式](#/zh-CN/component/date-picker#ri-qi-ge-shi) | — |
169
+ | default-value | 可选,选择器打开时默认显示的时间 | Date(TimePicker) / string(TimeSelect) | 可被`new Date()`解析(TimePicker) / 可选值(TimeSelect) | — |
170
+ | name | 原生属性 | string | — | — |
171
+ | prefix-icon | 自定义头部图标的类名 | string | — | el-icon-time |
172
+ | clear-icon | 自定义清空图标的类名 | string | — | el-icon-circle-close |
173
+
174
+ ### Time Select Options
175
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
176
+ |---------- |-------------- |---------- |-------------------------------- |-------- |
177
+ | start | 开始时间 | string | — | 09:00 |
178
+ | end | 结束时间 | string | — | 18:00 |
179
+ | step | 间隔时间 | string | — | 00:30 |
180
+ | minTime | 最小时间,小于该时间的时间段将被禁用 | string | — | 00:00 |
181
+ | maxTime | 最大时间,大于该时间的时间段将被禁用 | string | — | — |
182
+
183
+ ### Time Picker Options
184
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
185
+ |---------- |-------------- |---------- |-------------------------------- |-------- |
186
+ | selectableRange | 可选时间段,例如`'18:30:00 - 20:30:00'`或者传入数组`['09:30:00 - 12:00:00', '14:30:00 - 18:30:00']` | string / array | — | — |
187
+ | format | 时间格式化(TimePicker) | string | 小时:`HH`,分:`mm`,秒:`ss`,AM/PM `A` | 'HH:mm:ss' |
188
+
189
+ ### Events
190
+ | 事件名 | 说明 | 参数 |
191
+ |---------|--------|---------|
192
+ | change | 用户确认选定的值时触发 | 组件绑定值 |
193
+ | blur | 当 input 失去焦点时触发 | 组件实例 |
194
+ | focus | 当 input 获得焦点时触发 | 组件实例 |
195
+
196
+ ### Methods
197
+ | 方法名 | 说明 | 参数 |
198
+ | ---- | ---- | ---- |
199
+ | focus | 使 input 获取焦点 | - |