@gmcb/uv-ui 0.2.27 → 0.3.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -141
  3. package/docs/api/configs/color.md +52 -0
  4. package/docs/api/index.md +77 -0
  5. package/docs/api/mixins/mpShare.md +95 -0
  6. package/docs/api/request/apiManage.md +88 -0
  7. package/docs/api/request/http.md +451 -0
  8. package/docs/api/utils/colorSwitch.md +78 -0
  9. package/docs/api/utils/debounce.md +104 -0
  10. package/docs/api/utils/fastUse.md +246 -0
  11. package/docs/api/utils/getRect.md +238 -0
  12. package/docs/api/utils/guid.md +41 -0
  13. package/docs/api/utils/index.md +55 -0
  14. package/docs/api/utils/intro.md +25 -0
  15. package/docs/api/utils/object.md +171 -0
  16. package/docs/api/utils/queryParams.md +68 -0
  17. package/docs/api/utils/random.md +23 -0
  18. package/docs/api/utils/randomArray.md +28 -0
  19. package/docs/api/utils/route.md +121 -0
  20. package/docs/api/utils/test.md +237 -0
  21. package/docs/api/utils/time.md +81 -0
  22. package/docs/api/utils/trim.md +24 -0
  23. package/docs/components/actionSheet.md +236 -0
  24. package/docs/components/addQQGroup.md +5 -0
  25. package/docs/components/album.md +91 -0
  26. package/docs/components/alert.md +83 -0
  27. package/docs/components/avatar.md +152 -0
  28. package/docs/components/backTop.md +181 -0
  29. package/docs/components/badge.md +117 -0
  30. package/docs/components/button.md +196 -0
  31. package/docs/components/calendar.md +398 -0
  32. package/docs/components/calendars.md +294 -0
  33. package/docs/components/cell.md +185 -0
  34. package/docs/components/checkbox.md +281 -0
  35. package/docs/components/circleProgress.md +5 -0
  36. package/docs/components/code.md +162 -0
  37. package/docs/components/codeInput.md +175 -0
  38. package/docs/components/collapse.md +250 -0
  39. package/docs/components/color.md +324 -0
  40. package/docs/components/common.md +126 -0
  41. package/docs/components/countDown.md +166 -0
  42. package/docs/components/countTo.md +140 -0
  43. package/docs/components/datetimePicker.md +283 -0
  44. package/docs/components/diff1.x.md +190 -0
  45. package/docs/components/divider.md +88 -0
  46. package/docs/components/downloadSetting.md +54 -0
  47. package/docs/components/dropDown.md +375 -0
  48. package/docs/components/empty.md +99 -0
  49. package/docs/components/feature.md +261 -0
  50. package/docs/components/form.md +736 -0
  51. package/docs/components/gap.md +49 -0
  52. package/docs/components/grid.md +225 -0
  53. package/docs/components/icon.md +101 -0
  54. package/docs/components/image.md +182 -0
  55. package/docs/components/index.md +110 -0
  56. package/docs/components/indexList.md +133 -0
  57. package/docs/components/input.md +250 -0
  58. package/docs/components/install.md +59 -0
  59. package/docs/components/intro.md +32 -0
  60. package/docs/components/keyboard.md +226 -0
  61. package/docs/components/layout.md +310 -0
  62. package/docs/components/line.md +85 -0
  63. package/docs/components/lineProgress.md +141 -0
  64. package/docs/components/link.md +89 -0
  65. package/docs/components/list.md +223 -0
  66. package/docs/components/loadMore.md +140 -0
  67. package/docs/components/loadingIcon.md +144 -0
  68. package/docs/components/loadingPage.md +92 -0
  69. package/docs/components/modal.md +230 -0
  70. package/docs/components/more.md +13 -0
  71. package/docs/components/navbar.md +192 -0
  72. package/docs/components/noNetwork.md +116 -0
  73. package/docs/components/noticeBar.md +131 -0
  74. package/docs/components/notify.md +204 -0
  75. package/docs/components/npmSetting.md +64 -0
  76. package/docs/components/numberBox.md +257 -0
  77. package/docs/components/nvue.md +170 -0
  78. package/docs/components/overlay.md +117 -0
  79. package/docs/components/parse.md +204 -0
  80. package/docs/components/pickColor.md +112 -0
  81. package/docs/components/picker.md +357 -0
  82. package/docs/components/popup.md +221 -0
  83. package/docs/components/problem.md +300 -0
  84. package/docs/components/qrcode.md +169 -0
  85. package/docs/components/quickstart.md +33 -0
  86. package/docs/components/radio.md +256 -0
  87. package/docs/components/rate.md +128 -0
  88. package/docs/components/read.md +163 -0
  89. package/docs/components/readMore.md +227 -0
  90. package/docs/components/resource.md +17 -0
  91. package/docs/components/scrollList.md +218 -0
  92. package/docs/components/search.md +160 -0
  93. package/docs/components/setting.md +111 -0
  94. package/docs/components/settingDesc.md +66 -0
  95. package/docs/components/skeleton.md +105 -0
  96. package/docs/components/skeletons.md +323 -0
  97. package/docs/components/slider.md +157 -0
  98. package/docs/components/steps.md +189 -0
  99. package/docs/components/sticky.md +76 -0
  100. package/docs/components/subsection.md +183 -0
  101. package/docs/components/swipeAction.md +279 -0
  102. package/docs/components/swiper.md +352 -0
  103. package/docs/components/switch.md +216 -0
  104. package/docs/components/tabbar.md +263 -0
  105. package/docs/components/table.md +5 -0
  106. package/docs/components/tabs.md +364 -0
  107. package/docs/components/tag.md +227 -0
  108. package/docs/components/testPic.md +20 -0
  109. package/docs/components/text.md +157 -0
  110. package/docs/components/textarea.md +121 -0
  111. package/docs/components/toast.md +124 -0
  112. package/docs/components/tooltip.md +98 -0
  113. package/docs/components/transition.md +404 -0
  114. package/docs/components/upload.md +253 -0
  115. package/docs/components/vtabs.md +332 -0
  116. package/docs/components/vueUse.md +45 -0
  117. package/docs/components/vuexDetail.md +103 -0
  118. package/docs/components/waterfall.md +651 -0
  119. package/docs/faq/index.md +53 -0
  120. package/docs/guide/codeHint.md +44 -0
  121. package/docs/guide/customIcon.md +168 -0
  122. package/docs/guide/demo.md +92 -0
  123. package/docs/guide/design.md +56 -0
  124. package/docs/guide/globalVariable.md +239 -0
  125. package/docs/guide/i18n.md +194 -0
  126. package/docs/guide/index.md +28 -0
  127. package/docs/guide/note.md +74 -0
  128. package/docs/guide/safeAreaInset.md +64 -0
  129. package/docs/guide/theme.md +67 -0
  130. package/docs/index.md +88 -0
  131. package/libs/config/config.js +0 -10
  132. package/libs/css/color.scss +15 -14
  133. package/package.json +7 -2
  134. package/theme.scss +2 -1
@@ -0,0 +1,88 @@
1
+ ## Divider 分割线 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsA/divider/divider"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-divider**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-divider)
10
+
11
+ :::
12
+
13
+ 区隔内容的分割线,用于页面底部“没有更多”的提示等场景。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ 文字内容通过`text`传入
24
+
25
+ ```vue
26
+ <uv-divider text="分割线"></uv-divider>
27
+ ```
28
+
29
+ ### 设置虚线
30
+ 可以通过`dashed`指定虚线
31
+ ```vue
32
+ <uv-divider text="分割线" :dashed="true"></uv-divider>
33
+ ```
34
+
35
+ ### 设置细线
36
+ 可以通过`hairline`指定细线
37
+ ```vue
38
+ <uv-divider text="分割线" :hairline="true"></uv-divider>
39
+ ```
40
+
41
+ ### 设置以点代替文字
42
+ 可以通过`dot`指定以点代替文字
43
+ ```vue
44
+ <uv-divider text="分割线" :dot="true"></uv-divider>
45
+ ```
46
+
47
+ ### 设置文本靠左靠右
48
+ 可以通过`textPosition`指定文字靠左靠右
49
+ ```vue
50
+ <uv-divider text="靠左" textPosition="left"></uv-divider>
51
+ <uv-divider text="靠右" textPosition="right"></uv-divider>
52
+ ```
53
+
54
+ ### 设置文本颜色和线条颜色
55
+ 可以通过`textColor`和`lineColor`指定文字刚线条颜色
56
+ ```vue
57
+ <uv-divider text="分割线" textColor="#2979ff" lineColor="#ff0000"></uv-divider>
58
+ ```
59
+
60
+ ### 完整示例
61
+
62
+ ::: tip 完整示例下载地址
63
+
64
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
65
+
66
+ :::
67
+
68
+ ### API
69
+
70
+ ### Divider Props
71
+
72
+ | 参数 | 说明 | 类型 |默认值 | 可选值 |
73
+ |:- |:- |:- |:- |:- |
74
+ | dashed | 是否虚线 | Boolean | false | true &#124; false |
75
+ | hairline | 是否细线 | Boolean | true | true &#124; false |
76
+ | dot | 是否以点替代文字,优先于text字段起作用 | Boolean | false | true &#124; false |
77
+ | textPosition | 内容文本的位置 | String | center | center &#124; left &#124; right |
78
+ | text | 文本内容 | String &#124; Number | - | - |
79
+ | textSize | 文本大小 | String &#124; Number | 14 | - |
80
+ | textColor | 文本颜色 | String | #909399 | - |
81
+ | lineColor | 线条颜色 | String | #dcdfe6 | - |
82
+
83
+
84
+ ### Divider Events
85
+
86
+ |事件名 |说明 |回调参数 |
87
+ |:- |:- |:- |
88
+ | @click | divider组件被点击时触发 | - |
@@ -0,0 +1,54 @@
1
+ ## 下载安装方式配置
2
+
3
+ 如果项目通过 `uni_modules` 方式引入 uv-ui,请在 Vue 3 项目中按下面方式接入。npm 项目优先阅读 [NPM 安装方式配置](/components/npmSetting.html)。
4
+
5
+ ### SCSS
6
+
7
+ uv-ui 依赖 SCSS。HBuilderX 项目请确认已安装 `scss/sass 编译` 插件;CLI 项目请安装:
8
+
9
+ ```sh
10
+ npm i sass -D
11
+ ```
12
+
13
+ ### 注册插件
14
+
15
+ ```js
16
+ // main.js
17
+ import App from './App';
18
+ import { createSSRApp } from 'vue';
19
+ import uvUI from '@/uni_modules/uv-ui';
20
+
21
+ export function createApp() {
22
+ const app = createSSRApp(App);
23
+ app.use(uvUI);
24
+ return { app };
25
+ }
26
+ ```
27
+
28
+ ### 引入主题变量
29
+
30
+ ```scss
31
+ /* uni.scss */
32
+ @import '@/uni_modules/uv-ui/theme.scss';
33
+ ```
34
+
35
+ ### 引入基础样式
36
+
37
+ ```vue
38
+ <!-- App.vue -->
39
+ <style lang="scss">
40
+ @import '@/uni_modules/uv-ui/index.scss';
41
+ </style>
42
+ ```
43
+
44
+ ### easycom
45
+
46
+ 如果使用 `uni_modules` 安装,通常无需额外配置 easycom。若项目需要手动配置,可在 `pages.json` 中写入:
47
+
48
+ ```json
49
+ {
50
+ "easycom": {
51
+ "^uv-(.*)": "@/uni_modules/uv-ui/components/uv-$1/uv-$1.vue"
52
+ }
53
+ }
54
+ ```
@@ -0,0 +1,375 @@
1
+ ## DropDown 下拉筛选
2
+
3
+ <demo-model url="/pages/componentsB/dropDown/dropDown"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-drop-down**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-drop-down)
10
+
11
+ :::
12
+
13
+ 该组件主要提供筛选下拉筛选框,内置基础筛选功能,可以根据自己的需求自定义筛选项。
14
+
15
+ 兼容app-nvue,需要内置三个组件进行配合使用,uv-drop-down属于菜单项(其实还包括子组件uv-drop-down-item),uv-drop-down-popup属于筛选框。
16
+
17
+ 只需要做简单的约定式配置,即可使用该功能,兼容性良好,已经在多端进行了多次测试。
18
+
19
+ ### 平台兼容性
20
+
21
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
22
+ |:-:|:-:|:-:|:-:|:-:|:-:|
23
+ |√|√|√|√|√|√|
24
+
25
+ ### 基本用法
26
+
27
+ 该用法只提供选择项及配置的方式和下拉框盒子,内容需要自己定义。
28
+
29
+ #### uv-drop-down
30
+
31
+ - 设置 `sign` 属性,保证组件唯一性,如果一个项目用到多个该组件,就需要将每个 `sign` 设置不同,组件内部使用了uni.$on监听,不设置可能会互相影响。`uv-drop-down`和`uv-drop-down-popup`组件都需设置且值必须相等。
32
+ - 设置 `defaultValue` 属性,默认值,如下设置[0,'0','all'],如果value等于0或'0'即代表该选项还未进行选择,即不是选中状态。
33
+
34
+ #### uv-drop-down-item
35
+
36
+ - 设置 `name` 属性,选择项的字段标识,在处理逻辑的时候会用到。
37
+ - 设置 `label` 属性,展示选中或未选中的文本。
38
+ - 设置 `value` 属性,该项的值,如果不是defaultValue中的值,即是选中状态。
39
+ - 设置 `type` 属性,1 - 没有筛选项,表示是否选中,2 - 有多个筛选项。
40
+
41
+ ```vue
42
+ <template>
43
+ <view style="height: 1000px;">
44
+ <uv-drop-down
45
+ ref="dropDown"
46
+ sign="dropDown_1"
47
+ :defaultValue="[0,'0','all']"
48
+ >
49
+ <uv-drop-down-item
50
+ name="order"
51
+ type="2"
52
+ label="综合排序"
53
+ value="all">
54
+ </uv-drop-down-item>
55
+ <uv-drop-down-item
56
+ name="type"
57
+ type="2"
58
+ label="文档格式"
59
+ value="0">
60
+ </uv-drop-down-item>
61
+ <uv-drop-down-item
62
+ name="vip_type"
63
+ type="1"
64
+ label='VIP文档'
65
+ :value="0">
66
+ </uv-drop-down-item>
67
+ </uv-drop-down>
68
+ <uv-drop-down-popup
69
+ sign="dropDown_1"
70
+ @popupChange="change"
71
+ >
72
+ <view style="width: 750rpx;height: 300rpx;background-color: #fff;"></view>
73
+ </uv-drop-down-popup>
74
+ </view>
75
+ </template>
76
+ <script setup>
77
+ import { ref } from 'vue';
78
+
79
+ const dropDown = ref(null);
80
+ function change(e) {
81
+ console.log('弹窗打开状态:', e);
82
+ }
83
+
84
+ </script>
85
+ ```
86
+
87
+ ### 完整示例
88
+
89
+ 使用内置筛选项,就需要根据约定参数,格式可以直接使用如下示例,每个参数的作用会在下方说明:
90
+
91
+ ```vue
92
+ <template>
93
+ <view>
94
+ <uv-drop-down
95
+ ref="dropDown"
96
+ sign="dropDown_1"
97
+ text-active-color="#3c9cff"
98
+ :extra-icon="{name:'arrow-down-fill',color:'#666',size:'26rpx'}"
99
+ :extra-active-icon="{name:'arrow-up-fill',color:'#3c9cff',size:'26rpx'}"
100
+ :defaultValue="defaultValue"
101
+ :custom-style="{padding: '0 30rpx'}"
102
+ @click="selectMenu"
103
+ >
104
+ <uv-drop-down-item
105
+ name="order"
106
+ type="2"
107
+ :label="dropItem('order').label"
108
+ :value="dropItem('order').value">
109
+ </uv-drop-down-item>
110
+ <uv-drop-down-item
111
+ name="type"
112
+ type="2"
113
+ :label="dropItem('type').label"
114
+ :value="dropItem('type').value">
115
+ </uv-drop-down-item>
116
+ <uv-drop-down-item
117
+ name="vip_type"
118
+ type="1" label='VIP文档'
119
+ :value="dropItem('vip_type').value">
120
+ </uv-drop-down-item>
121
+ </uv-drop-down>
122
+ <uv-drop-down-popup
123
+ sign="dropDown_1"
124
+ :click-overlay-on-close="true"
125
+ :currentDropItem="currentDropItem"
126
+ @clickItem="clickItem"
127
+ @popupChange="change"
128
+ ></uv-drop-down-popup>
129
+ </view>
130
+ </template>
131
+ <script setup>
132
+ import { computed, ref } from 'vue';
133
+
134
+ function setValue(target, key, value) {
135
+ target[key] = value;
136
+ }
137
+ const dropDown = ref(null);
138
+ const defaultValue = ref([0, 'all', '0']);
139
+ const result = ref([{
140
+ name: 'order',
141
+ label: '最新发布',
142
+ value: 'new'
143
+ }]);
144
+ const activeName = ref('order');
145
+ const order = ref({
146
+ label: '综合排序',
147
+ value: 'all',
148
+ activeIndex: 0,
149
+ color: '#333',
150
+ activeColor: '#2878ff',
151
+ child: [{
152
+ label: '综合排序',
153
+ value: 'all'
154
+ }, {
155
+ label: '最新发布',
156
+ value: 'new'
157
+ }, {
158
+ label: '低价优先',
159
+ value: 'money'
160
+ }]
161
+ });
162
+ const type = ref({
163
+ label: '文档格式',
164
+ value: 'all',
165
+ activeIndex: 0,
166
+ color: '#333',
167
+ activeColor: '#2878ff',
168
+ child: [{
169
+ label: '全部',
170
+ value: 'all'
171
+ }, {
172
+ label: 'PDF',
173
+ value: 'pdf'
174
+ }, {
175
+ label: 'WROD',
176
+ value: 'word'
177
+ }, {
178
+ label: 'PPT',
179
+ value: 'ppt'
180
+ }]
181
+ });
182
+ const vip_type = ref({
183
+ label: 'VIP文档',
184
+ value: 0,
185
+ activeIndex: 0
186
+ });
187
+ const filterMap = {
188
+ order,
189
+ type,
190
+ vip_type
191
+ };
192
+ const dropItem = computed(() => {
193
+ return name => {
194
+ const selected = {};
195
+ const find = result.value.find(item => item.name === name);
196
+ if (find) {
197
+ selected.label = find.label;
198
+ selected.value = find.value;
199
+ } else {
200
+ selected.label = filterMap[name].value.label;
201
+ selected.value = filterMap[name].value.value;
202
+ }
203
+ return selected;
204
+ };
205
+ });
206
+ const currentDropItem = computed(() => {
207
+ return filterMap[activeName.value].value;
208
+ });
209
+ function change(e) {
210
+ console.log('弹窗打开状态:', e);
211
+ }
212
+ function selectMenu(e) {
213
+ const {
214
+ name,
215
+ active,
216
+ type
217
+ } = e;
218
+ activeName.value = name;
219
+ // type 等于1 的需要特殊处理:type不等于1可以忽略
220
+ if (type == 1) {
221
+ clickItem({
222
+ name: 'vip_type',
223
+ label: 'VIP文档',
224
+ value: e.active ? 1 : 0
225
+ });
226
+ } else {
227
+ const find = result.value.find(item => item.name == activeName.value);
228
+ if (find) {
229
+ const activeItem = filterMap[activeName.value].value;
230
+ const findIndex = activeItem.child.findIndex(item => item.label == find.label && item.value == find.value);
231
+ activeItem.activeIndex = findIndex;
232
+ } else {
233
+ filterMap[activeName.value].value.activeIndex = 0;
234
+ }
235
+ }
236
+ }
237
+ function clickItem(e) {
238
+ // 下面有重新赋值,所以用let
239
+ let {
240
+ label,
241
+ value
242
+ } = e;
243
+ const findIndex = result.value.findIndex(item => item.name == activeName.value);
244
+ if (defaultValue.value.indexOf(value) > -1 && filterMap[activeName.value].value.label) {
245
+ label = filterMap[activeName.value].value.label;
246
+ }
247
+ // 已经存在筛选项
248
+ if (findIndex > -1) {
249
+ setValue(result.value, findIndex, {
250
+ name: activeName.value,
251
+ label,
252
+ value
253
+ });
254
+ } else {
255
+ result.value.push({
256
+ name: activeName.value,
257
+ label,
258
+ value
259
+ });
260
+ }
261
+ result.value = result.value.filter(item => defaultValue.value.indexOf(item.value) == -1);
262
+ uni.showModal({
263
+ content: `筛选的值:${JSON.stringify(result.value)}`
264
+ });
265
+ }
266
+
267
+ </script>
268
+ ```
269
+
270
+ ### 完整示例
271
+
272
+ ::: tip 完整示例下载地址
273
+
274
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
275
+
276
+ :::
277
+
278
+ ### API
279
+ ---
280
+
281
+ ### DropDown Props
282
+
283
+ | 参数 | 类型 | 默认值 | 说明 |
284
+ |:-|:-|:-|:-|
285
+ | sign | String &#124; Number | UVDROPDOWN | 组件唯一标识,需要手动传 |
286
+ | default-value | Array | [0,'0','all'] | 默认值,表示参数value属于这里面的值,就说明是未选中即是默认展示的值。eg:上面示例中的{label: '全部',value: 'all'} 即是默认值。后续处理逻辑也可以根据是否是其中值进行过滤。 |
287
+ | is-sticky | Boolean | true | 是否吸顶 |
288
+ | text-size | String | 30rpx | 每项字体大小 |
289
+ | text-color | String | #333 | 每项文本颜色 |
290
+ | text-active-size | String | 30rpx | 每项选中状态字体大小 |
291
+ | text-active-color | String | #3c9cff | 每项选中状态文本颜色 |
292
+ | extra-icon | Object | {name: 'arrow-down', size: '30rpx', color: '#333'} | 每项右侧图标,暂时只支持设置默认值中的3个参数,参考 [uv-icon](https://www.uvui.cn/components/icon.html) |
293
+ | extra-active-icon | Object | {name: 'arrow-up', size: '30rpx', color: '#3c9cff'} | 每项选中后右侧图标,暂时只支持设置默认值中的3个参数,参考 [uv-icon](https://www.uvui.cn/components/icon.html) |
294
+
295
+ ### DropDownItem Props
296
+
297
+ | 参数 | 类型 | 默认值 | 说明 |
298
+ |:-|:-|:-|:-|
299
+ | name | String &#124; Number | - | 字段标识 |
300
+ | type | String &#124; Number | - | 类型 1 没有筛选项,直接进行选中和不选中 2 有多个选项 |
301
+ | label | String | - | 筛选的文本 |
302
+ | value | String &#124; Number &#124; null | - | 筛选的值 |
303
+ | is-drop | Boolean | false | 该项是否打开,可用于重置选项状态 |
304
+
305
+ ### DropDownPopup Props
306
+
307
+ | 参数 | 类型 | 默认值 | 说明 |
308
+ |:-|:-|:-|:-|
309
+ | sign | String &#124; Number | UVDROPDOWN | 组件唯一标识,需要手动传,与DropDown组件必须保持一致 |
310
+ | z-index | String &#124; Number | 999 | 弹出层的层级 |
311
+ | opacity | String &#124; Number | 0.5 | 遮罩层的透明度 |
312
+ | click-overlay-on-close | Boolean | true | 是否允许点击遮罩层关闭弹窗 |
313
+ | current-drop-item | Object | - | 当前下拉筛选菜单对象 |
314
+ | key-name | String | label | 指定从当前下拉筛选菜单对象元素中读取哪个属性作为文本展示 |
315
+
316
+ ### DropDown Events
317
+
318
+ | 事件名 | 说明 |返回参数 |
319
+ |:- |:- |:- |
320
+ | @selectMenu | 点击每项菜单回调 | { name, active, type } = e,active - 是否打开该项 |
321
+
322
+ ### DropDownPopup Events
323
+
324
+ | 事件名 | 说明 |返回参数 |
325
+ |:- |:- |:- |
326
+ | @clickItem | 点击筛选回调处理 | { label, value } = e |
327
+ | @popupChange | 打开关闭弹窗触发 | { show }=e,true或false |
328
+
329
+ ### DropDown Methods
330
+
331
+ | 名称 | 说明 |
332
+ |:- |:- |
333
+ | init | 初始化弹窗的位置,在滚动时可以调用此方法,及时更新位置 |
334
+
335
+ ### DropDownPopup Methods
336
+
337
+ | 名称 | 说明 |
338
+ |:- |:- |
339
+ | open | 打开弹窗 |
340
+ | close | 关闭弹窗 |
341
+
342
+ ### DropDownPopup Slots
343
+ |名称 | 说明 |
344
+ |:- |:- |
345
+ | default | 默认插槽,完全自定义内容,包括逻辑都需自己写 |
346
+
347
+ <style scoped>
348
+ h3[id=dropdown-props] + table thead tr th:nth-child(1),
349
+ h3[id=dropdown-props] + table thead tr th:nth-child(2),
350
+ h3[id=dropdown-props] + table thead tr th:nth-child(3)
351
+ {
352
+ width: 18%;
353
+ }
354
+ h3[id=dropdownitem-props] + table thead tr th:nth-child(1),
355
+ h3[id=dropdownitem-props] + table thead tr th:nth-child(2),
356
+ h3[id=dropdownitem-props] + table thead tr th:nth-child(3)
357
+ {
358
+ width: 18%;
359
+ }
360
+ h3[id=dropdownpopup-props] + table thead tr th:nth-child(1),
361
+ h3[id=dropdownpopup-props] + table thead tr th:nth-child(2),
362
+ h3[id=dropdownpopup-props] + table thead tr th:nth-child(3)
363
+ {
364
+ width: 18%;
365
+ }
366
+ h3[id=dropdownpopup-slots] + table thead tr th:nth-child(2)
367
+ {
368
+ width: 80%;
369
+ }
370
+ h3[id=dropdownpopup-methods] + table thead tr th:nth-child(2),
371
+ h3[id=dropdown-methods] + table thead tr th:nth-child(2)
372
+ {
373
+ width: 70%;
374
+ }
375
+ </style>
@@ -0,0 +1,99 @@
1
+ ## Empty 内容为空 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/empty/empty"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-empty**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-empty)
10
+
11
+ :::
12
+
13
+ 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个“没有内容”的场景,
14
+ 我们精心挑选了十几个场景的图标,方便您直接使用。
15
+
16
+ ### 平台兼容性
17
+
18
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
19
+ |:-:|:-:|:-:|:-:|:-:|:-:|
20
+ |√|√|√|√|√|√|
21
+
22
+ :::tip 提示
23
+ 我们的专业设计师精心为您准备了一套精美默认图,带有图片和`Sketch`文件,您可以下载或修改后再使用:<a href="/components/resource.html" target="_blank">资源下载</a>
24
+ :::
25
+
26
+ ### 基本使用
27
+
28
+ - 通过`text`参数配置提示的文字内容
29
+ - 通过`mode`(默认为`data`)参数配置要显示的图标
30
+
31
+ ```vue
32
+ <uv-empty mode="car" icon="https://cdn.uviewui.com/uview/empty/car.png"></uv-empty>
33
+ ```
34
+
35
+ ### 内置图标
36
+
37
+ 这些图标已内置,直接通过`mode`参数引用即可
38
+
39
+ | 名称 | 说明 |
40
+ |:- |:- |
41
+ | car | 购物车为空 |
42
+ | page | 页面不存在 |
43
+ | search | 没有搜索结果 |
44
+ | address | 没有收货地址 |
45
+ | wifi-off | 没有WiFi |
46
+ | order | 订单为空 |
47
+ | coupon | 没有优惠券 |
48
+ | favor | 无收藏 |
49
+ | permission| 无权限 |
50
+ | history | 无历史记录 |
51
+ | news | 无新闻列表 |
52
+ | message | 消息列表为空 |
53
+ | list | 列表为空(通用) |
54
+ | data | 数据为空(默认,通用) |
55
+
56
+ ### 完整示例
57
+
58
+ ::: tip 完整示例下载地址
59
+
60
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
61
+
62
+ :::
63
+
64
+ ### API
65
+ ---
66
+
67
+ ### Empty Props
68
+
69
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
70
+ |:- |:- |:- |:- |:- |
71
+ | icon | 内置图标名称,或图片路径,建议绝对路径,支持base64图片 | String | - | - |
72
+ | text | 文字提示 | String | - | - |
73
+ | textColor | 文字颜色 | String | #c0c4cc | - |
74
+ | textSize | 文字大小 | String &#124; Number | 14 | - |
75
+ | iconColor | 图标的颜色 | String | #c0c4cc | - |
76
+ | iconSize | 图标的大小 | String &#124; Number | 90 | - |
77
+ | mode | 内置的图标,见上方说明 | String | data | - |
78
+ | width | 图标的宽度,单位px | String &#124; Number | 160 | - |
79
+ | height | 图标的高度,单位px | String &#124; Number | 160 | - |
80
+ | show | 是否显示组件 | Boolean | true | true &#124; false |
81
+ | marginTop | 组件到上一个元素的间距,单位px | String &#124; Number | 0 | - |
82
+
83
+
84
+
85
+ ### Empty Slots
86
+
87
+ | 名称 | 说明 |
88
+ |:- |:- |
89
+ | - | 给组件底部传入`slot`内容 |
90
+
91
+
92
+ <style scoped>
93
+ h3[id=内置图标] + p + table thead tr th:nth-child(2){
94
+ width: 70%;
95
+ }
96
+ h3[id=empty-slots] + table thead tr th:nth-child(2){
97
+ width: 70%;
98
+ }
99
+ </style>