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,211 @@
1
+ ## Radio 单选框
2
+
3
+ 在一组备选项中进行单选
4
+
5
+ ### 基础用法
6
+
7
+ 由于选项默认可见,不宜过多,若选项过多,建议使用 Select 选择器。
8
+
9
+ :::demo 要使用 Radio 组件,只需要设置`v-model`绑定变量,选中意味着变量的值为相应 Radio `label`属性的值,`label`可以是`String`、`Number`或`Boolean`。
10
+
11
+ ```html
12
+ <template>
13
+ <el-radio v-model="radio" label="1">备选项</el-radio>
14
+ <el-radio v-model="radio" label="2">备选项</el-radio>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ data () {
20
+ return {
21
+ radio: '1'
22
+ };
23
+ }
24
+ }
25
+ </script>
26
+ ```
27
+ :::
28
+
29
+ ### 禁用状态
30
+
31
+ 单选框不可用的状态。
32
+
33
+ :::demo 只要在`el-radio`元素中设置`disabled`属性即可,它接受一个`Boolean`,`true`为禁用。
34
+ ```html
35
+ <template>
36
+ <el-radio disabled v-model="radio" label="禁用">备选项</el-radio>
37
+ <el-radio disabled v-model="radio" label="选中且禁用">备选项</el-radio>
38
+ </template>
39
+
40
+ <script>
41
+ export default {
42
+ data () {
43
+ return {
44
+ radio: '选中且禁用'
45
+ };
46
+ }
47
+ }
48
+ </script>
49
+ ```
50
+ :::
51
+
52
+ ### 单选框组
53
+
54
+ 适用于在多个互斥的选项中选择的场景
55
+
56
+ :::demo 结合`el-radio-group`元素和子元素`el-radio`可以实现单选组,在`el-radio-group`中绑定`v-model`,在`el-radio`中设置好`label`即可,无需再给每一个`el-radio`绑定变量,另外,还提供了`change`事件来响应变化,它会传入一个参数`value`。
57
+
58
+ ```html
59
+ <template>
60
+ <el-radio-group v-model="radio">
61
+ <el-radio :label="3">备选项</el-radio>
62
+ <el-radio :label="6">备选项</el-radio>
63
+ <el-radio :label="9">备选项</el-radio>
64
+ </el-radio-group>
65
+ </template>
66
+
67
+ <script>
68
+ export default {
69
+ data () {
70
+ return {
71
+ radio: 3
72
+ };
73
+ }
74
+ }
75
+ </script>
76
+ ```
77
+ :::
78
+
79
+ ### 按钮样式
80
+
81
+ 按钮样式的单选组合。
82
+
83
+ :::demo 只需要把`el-radio`元素换成`el-radio-button`元素即可,此外,Element 还提供了`size`属性。
84
+ ```html
85
+ <template>
86
+ <div>
87
+ <el-radio-group v-model="radio1">
88
+ <el-radio-button label="上海"></el-radio-button>
89
+ <el-radio-button label="北京"></el-radio-button>
90
+ <el-radio-button label="广州"></el-radio-button>
91
+ <el-radio-button label="深圳"></el-radio-button>
92
+ </el-radio-group>
93
+ </div>
94
+ <div style="margin-top: 20px">
95
+ <el-radio-group v-model="radio2" size="medium">
96
+ <el-radio-button label="上海" ></el-radio-button>
97
+ <el-radio-button label="北京"></el-radio-button>
98
+ <el-radio-button label="广州"></el-radio-button>
99
+ <el-radio-button label="深圳"></el-radio-button>
100
+ </el-radio-group>
101
+ </div>
102
+ <div style="margin-top: 20px">
103
+ <el-radio-group v-model="radio3" size="small">
104
+ <el-radio-button label="上海"></el-radio-button>
105
+ <el-radio-button label="北京" disabled ></el-radio-button>
106
+ <el-radio-button label="广州"></el-radio-button>
107
+ <el-radio-button label="深圳"></el-radio-button>
108
+ </el-radio-group>
109
+ </div>
110
+ <div style="margin-top: 20px">
111
+ <el-radio-group v-model="radio4" disabled size="mini">
112
+ <el-radio-button label="上海"></el-radio-button>
113
+ <el-radio-button label="北京"></el-radio-button>
114
+ <el-radio-button label="广州"></el-radio-button>
115
+ <el-radio-button label="深圳"></el-radio-button>
116
+ </el-radio-group>
117
+ </div>
118
+ </template>
119
+
120
+ <script>
121
+ export default {
122
+ data () {
123
+ return {
124
+ radio1: '上海',
125
+ radio2: '上海',
126
+ radio3: '上海',
127
+ radio4: '上海'
128
+ };
129
+ }
130
+ }
131
+ </script>
132
+ ```
133
+ :::
134
+
135
+ ### 带有边框
136
+
137
+ :::demo 设置`border`属性可以渲染为带有边框的单选框。
138
+ ```html
139
+ <template>
140
+ <div>
141
+ <el-radio v-model="radio1" label="1" border>备选项1</el-radio>
142
+ <el-radio v-model="radio1" label="2" border>备选项2</el-radio>
143
+ </div>
144
+ <div style="margin-top: 20px">
145
+ <el-radio v-model="radio2" label="1" border size="medium">备选项1</el-radio>
146
+ <el-radio v-model="radio2" label="2" border size="medium">备选项2</el-radio>
147
+ </div>
148
+ <div style="margin-top: 20px">
149
+ <el-radio-group v-model="radio3" size="small">
150
+ <el-radio label="1" border>备选项1</el-radio>
151
+ <el-radio label="2" border disabled>备选项2</el-radio>
152
+ </el-radio-group>
153
+ </div>
154
+ <div style="margin-top: 20px">
155
+ <el-radio-group v-model="radio4" size="mini" disabled>
156
+ <el-radio label="1" border>备选项1</el-radio>
157
+ <el-radio label="2" border>备选项2</el-radio>
158
+ </el-radio-group>
159
+ </div>
160
+ </template>
161
+
162
+ <script>
163
+ export default {
164
+ data () {
165
+ return {
166
+ radio1: '1',
167
+ radio2: '1',
168
+ radio3: '1',
169
+ radio4: '1'
170
+ };
171
+ }
172
+ }
173
+ </script>
174
+ ```
175
+ :::
176
+
177
+ ### Radio Attributes
178
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
179
+ |---------- |-------- |---------- |------------- |-------- |
180
+ | value / v-model | 绑定值 | string / number / boolean | — | — |
181
+ | label | Radio 的 value | string / number / boolean | — | — |
182
+ | disabled | 是否禁用 | boolean | — | false |
183
+ | border | 是否显示边框 | boolean | — | false |
184
+ | size | Radio 的尺寸,仅在 border 为真时有效 | string | medium / small / mini | — |
185
+ | name | 原生 name 属性 | string | — | — |
186
+
187
+ ### Radio Events
188
+ | 事件名称 | 说明 | 回调参数 |
189
+ |---------- |-------- |---------- |
190
+ | change | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
191
+
192
+ ### Radio-group Attributes
193
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
194
+ |---------- |-------- |---------- |------------- |-------- |
195
+ | value / v-model | 绑定值 | string / number / boolean | — | — |
196
+ | size | 单选框组尺寸,仅对按钮形式的 Radio 或带有边框的 Radio 有效 | string | medium / small / mini | — |
197
+ | disabled | 是否禁用 | boolean | — | false |
198
+ | text-color | 按钮形式的 Radio 激活时的文本颜色 | string | — | #ffffff |
199
+ | fill | 按钮形式的 Radio 激活时的填充色和边框色 | string | — | #409EFF |
200
+
201
+ ### Radio-group Events
202
+ | 事件名称 | 说明 | 回调参数 |
203
+ |---------- |-------- |---------- |
204
+ | change | 绑定值变化时触发的事件 | 选中的 Radio label 值 |
205
+
206
+ ### Radio-button Attributes
207
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
208
+ |---------- |-------- |---------- |------------- |-------- |
209
+ | label | Radio 的 value | string / number | — | — |
210
+ | disabled | 是否禁用 | boolean | — | false |
211
+ | name | 原生 name 属性 | string | — | — |
@@ -0,0 +1,135 @@
1
+ ## Rate 评分
2
+
3
+ 评分组件
4
+
5
+ ### 基础用法
6
+
7
+ :::demo 评分默认被分为三个等级,可以利用颜色数组对分数及情感倾向进行分级(默认情况下不区分颜色)。三个等级所对应的颜色用`colors`属性设置,而它们对应的两个阈值则通过 `low-threshold` 和 `high-threshold` 设定。你也可以通过传入颜色对象来自定义分段,键名为分段的界限值,键值为对应的颜色。
8
+ ```html
9
+ <div class="block">
10
+ <span class="demonstration">默认不区分颜色</span>
11
+ <el-rate v-model="value1"></el-rate>
12
+ </div>
13
+ <div class="block">
14
+ <span class="demonstration">区分颜色</span>
15
+ <el-rate
16
+ v-model="value2"
17
+ :colors="colors">
18
+ </el-rate>
19
+ </div>
20
+
21
+ <script>
22
+ export default {
23
+ data() {
24
+ return {
25
+ value1: null,
26
+ value2: null,
27
+ colors: ['#99A9BF', '#F7BA2A', '#FF9900'] // 等同于 { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+ ```
33
+ :::
34
+
35
+ ### 辅助文字
36
+
37
+ 用辅助文字直接地表达对应分数
38
+
39
+ :::demo 为组件设置 `show-text` 属性会在右侧显示辅助文字。通过设置 `texts` 可以为每一个分值指定对应的辅助文字。`texts` 为一个数组,长度应等于最大值 `max`。
40
+ ```html
41
+ <el-rate
42
+ v-model="value"
43
+ show-text>
44
+ </el-rate>
45
+
46
+ <script>
47
+ export default {
48
+ data() {
49
+ return {
50
+ value: null
51
+ }
52
+ }
53
+ }
54
+ </script>
55
+ ```
56
+ :::
57
+
58
+ ### 其它 icon
59
+
60
+ 当有多层评价时,可以用不同类型的 icon 区分评分层级
61
+
62
+ :::demo 设置`icon-classes`属性可以自定义不同分段的图标。若传入数组,共有 3 个元素,为 3 个分段所对应的类名;若传入对象,可自定义分段,键名为分段的界限值,键值为对应的类名。本例还使用`void-icon-class`指定了未选中时的图标类名。
63
+ ```html
64
+ <el-rate
65
+ v-model="value"
66
+ :icon-classes="iconClasses"
67
+ void-icon-class="icon-rate-face-off"
68
+ :colors="['#99A9BF', '#F7BA2A', '#FF9900']">
69
+ </el-rate>
70
+
71
+ <script>
72
+ export default {
73
+ data() {
74
+ return {
75
+ value: null,
76
+ iconClasses: ['icon-rate-face-1', 'icon-rate-face-2', 'icon-rate-face-3'] // 等同于 { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
77
+ }
78
+ }
79
+ }
80
+ </script>
81
+ ```
82
+ :::
83
+
84
+ ### 只读
85
+
86
+ 只读的评分用来展示分数,允许出现半星
87
+
88
+ :::demo 为组件设置 `disabled` 属性表示组件为只读,支持小数分值。此时若设置 `show-score`,则会在右侧显示目前的分值。可以提供 `score-template` 作为显示模板,模板为一个包含了 `{value}` 的字符串,`{value}` 会被解析为分值。
89
+ ```html
90
+ <el-rate
91
+ v-model="value"
92
+ disabled
93
+ show-score
94
+ text-color="#ff9900"
95
+ score-template="{value}">
96
+ </el-rate>
97
+
98
+ <script>
99
+ export default {
100
+ data() {
101
+ return {
102
+ value: 3.7
103
+ }
104
+ }
105
+ }
106
+ </script>
107
+ ```
108
+ :::
109
+
110
+ ### Attributes
111
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
112
+ |---------- |-------- |---------- |------------- |-------- |
113
+ | value / v-model | 绑定值 | number | — | 0 |
114
+ | max | 最大分值 | number | — | 5 |
115
+ | disabled | 是否为只读 | boolean | — | false |
116
+ | allow-half | 是否允许半选 | boolean | — | false |
117
+ | low-threshold | 低分和中等分数的界限值,值本身被划分在低分中 | number | — | 2 |
118
+ | high-threshold | 高分和中等分数的界限值,值本身被划分在高分中 | number | — | 4 |
119
+ | colors | icon 的颜色。若传入数组,共有 3 个元素,为 3 个分段所对应的颜色;若传入对象,可自定义分段,键名为分段的界限值,键值为对应的颜色 | array/object | — | ['#F7BA2A', '#F7BA2A', '#F7BA2A'] |
120
+ | void-color | 未选中 icon 的颜色 | string | — | #C6D1DE |
121
+ | disabled-void-color | 只读时未选中 icon 的颜色 | string | — | #EFF2F7 |
122
+ | icon-classes | icon 的类名。若传入数组,共有 3 个元素,为 3 个分段所对应的类名;若传入对象,可自定义分段,键名为分段的界限值,键值为对应的类名 | array/object | — | ['el-icon-star-on', 'el-icon-star-on','el-icon-star-on'] |
123
+ | void-icon-class | 未选中 icon 的类名 | string | — | el-icon-star-off |
124
+ | disabled-void-icon-class | 只读时未选中 icon 的类名 | string | — | el-icon-star-on |
125
+ | show-text | 是否显示辅助文字,若为真,则会从 texts 数组中选取当前分数对应的文字内容 | boolean | — | false |
126
+ | show-score | 是否显示当前分数,show-score 和 show-text 不能同时为真 | boolean | — | false |
127
+ | text-color | 辅助文字的颜色 | string | — | #1F2D3D |
128
+ | texts | 辅助文字数组 | array | — | ['极差', '失望', '一般', '满意', '惊喜'] |
129
+ | score-template | 分数显示模板 | string | — | {value} |
130
+
131
+ ### Events
132
+ | 事件名称 | 说明 | 回调参数 |
133
+ |---------- |-------- |---------- |
134
+ | change | 分值改变时触发 | 改变后的分值 |
135
+
@@ -0,0 +1,76 @@
1
+ ## Result 结果
2
+
3
+ 用于对用户的操作结果或者异常状态做反馈。
4
+
5
+ ### 基础用法
6
+
7
+ :::demo
8
+
9
+ ```html
10
+ <el-row>
11
+ <el-col :sm="12" :lg="6">
12
+ <el-result icon="success" title="成功提示" subTitle="请根据提示进行操作">
13
+ <template slot="extra">
14
+ <el-button type="primary" size="medium">返回</el-button>
15
+ </template>
16
+ </el-result>
17
+ </el-col>
18
+ <el-col :sm="12" :lg="6">
19
+ <el-result icon="warning" title="警告提示" subTitle="请根据提示进行操作">
20
+ <template slot="extra">
21
+ <el-button type="primary" size="medium">返回</el-button>
22
+ </template>
23
+ </el-result>
24
+ </el-col>
25
+ <el-col :sm="12" :lg="6">
26
+ <el-result icon="error" title="错误提示" subTitle="请根据提示进行操作">
27
+ <template slot="extra">
28
+ <el-button type="primary" size="medium">返回</el-button>
29
+ </template>
30
+ </el-result>
31
+ </el-col>
32
+ <el-col :sm="12" :lg="6">
33
+ <el-result icon="info" title="信息提示" subTitle="请根据提示进行操作">
34
+ <template slot="extra">
35
+ <el-button type="primary" size="medium">返回</el-button>
36
+ </template>
37
+ </el-result>
38
+ </el-col>
39
+ </el-row>
40
+ ```
41
+
42
+ :::
43
+
44
+ ### 自定义内容
45
+
46
+ :::demo
47
+
48
+ ```html
49
+ <el-result title="404" subTitle="抱歉,请求错误">
50
+ <template slot="icon">
51
+ <el-image src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"></el-image>
52
+ </template>
53
+ <template slot="extra">
54
+ <el-button type="primary" size="medium">返回</el-button>
55
+ </template>
56
+ </el-result>
57
+ ```
58
+
59
+ :::
60
+
61
+ ### Result Attributes
62
+
63
+ | 参数 | 说明 | 类型 | 可选值 | 默认值 |
64
+ |------------- |---------------- |---------------- |---------------------- |-------- |
65
+ | title | 标题 | string | — | — |
66
+ | sub-title | 二级标题 | string | — | — |
67
+ | icon | 图标类型 | string | success / warning / info / error | info |
68
+
69
+ ### Result Slots
70
+
71
+ | Name | 说明 |
72
+ |------|--------|
73
+ | icon | 自定义图标 |
74
+ | title | 自定义标题 |
75
+ | subTitle | 自定义二级标题 |
76
+ | extra | 自定义底部额外区域 |