@gmcb/uv-ui 0.2.27 → 0.3.1

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 (135) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +21 -0
  3. package/README.md +95 -141
  4. package/docs/api/configs/color.md +52 -0
  5. package/docs/api/index.md +77 -0
  6. package/docs/api/mixins/mpShare.md +95 -0
  7. package/docs/api/request/apiManage.md +88 -0
  8. package/docs/api/request/http.md +451 -0
  9. package/docs/api/utils/colorSwitch.md +78 -0
  10. package/docs/api/utils/debounce.md +104 -0
  11. package/docs/api/utils/fastUse.md +246 -0
  12. package/docs/api/utils/getRect.md +238 -0
  13. package/docs/api/utils/guid.md +41 -0
  14. package/docs/api/utils/index.md +55 -0
  15. package/docs/api/utils/intro.md +25 -0
  16. package/docs/api/utils/object.md +171 -0
  17. package/docs/api/utils/queryParams.md +68 -0
  18. package/docs/api/utils/random.md +23 -0
  19. package/docs/api/utils/randomArray.md +28 -0
  20. package/docs/api/utils/route.md +121 -0
  21. package/docs/api/utils/test.md +237 -0
  22. package/docs/api/utils/time.md +81 -0
  23. package/docs/api/utils/trim.md +24 -0
  24. package/docs/components/actionSheet.md +236 -0
  25. package/docs/components/addQQGroup.md +5 -0
  26. package/docs/components/album.md +91 -0
  27. package/docs/components/alert.md +83 -0
  28. package/docs/components/avatar.md +152 -0
  29. package/docs/components/backTop.md +181 -0
  30. package/docs/components/badge.md +117 -0
  31. package/docs/components/button.md +196 -0
  32. package/docs/components/calendar.md +398 -0
  33. package/docs/components/calendars.md +294 -0
  34. package/docs/components/cell.md +185 -0
  35. package/docs/components/checkbox.md +281 -0
  36. package/docs/components/circleProgress.md +5 -0
  37. package/docs/components/code.md +162 -0
  38. package/docs/components/codeInput.md +175 -0
  39. package/docs/components/collapse.md +250 -0
  40. package/docs/components/color.md +324 -0
  41. package/docs/components/common.md +126 -0
  42. package/docs/components/countDown.md +166 -0
  43. package/docs/components/countTo.md +140 -0
  44. package/docs/components/datetimePicker.md +283 -0
  45. package/docs/components/diff1.x.md +190 -0
  46. package/docs/components/divider.md +88 -0
  47. package/docs/components/downloadSetting.md +54 -0
  48. package/docs/components/dropDown.md +375 -0
  49. package/docs/components/empty.md +99 -0
  50. package/docs/components/feature.md +261 -0
  51. package/docs/components/form.md +736 -0
  52. package/docs/components/gap.md +49 -0
  53. package/docs/components/grid.md +225 -0
  54. package/docs/components/icon.md +101 -0
  55. package/docs/components/image.md +182 -0
  56. package/docs/components/index.md +110 -0
  57. package/docs/components/indexList.md +133 -0
  58. package/docs/components/input.md +250 -0
  59. package/docs/components/install.md +59 -0
  60. package/docs/components/intro.md +32 -0
  61. package/docs/components/keyboard.md +226 -0
  62. package/docs/components/layout.md +310 -0
  63. package/docs/components/line.md +85 -0
  64. package/docs/components/lineProgress.md +141 -0
  65. package/docs/components/link.md +89 -0
  66. package/docs/components/list.md +223 -0
  67. package/docs/components/loadMore.md +140 -0
  68. package/docs/components/loadingIcon.md +144 -0
  69. package/docs/components/loadingPage.md +92 -0
  70. package/docs/components/modal.md +230 -0
  71. package/docs/components/more.md +13 -0
  72. package/docs/components/navbar.md +192 -0
  73. package/docs/components/noNetwork.md +116 -0
  74. package/docs/components/noticeBar.md +131 -0
  75. package/docs/components/notify.md +204 -0
  76. package/docs/components/npmSetting.md +64 -0
  77. package/docs/components/numberBox.md +257 -0
  78. package/docs/components/nvue.md +170 -0
  79. package/docs/components/overlay.md +117 -0
  80. package/docs/components/parse.md +204 -0
  81. package/docs/components/pickColor.md +112 -0
  82. package/docs/components/picker.md +357 -0
  83. package/docs/components/popup.md +221 -0
  84. package/docs/components/problem.md +300 -0
  85. package/docs/components/qrcode.md +169 -0
  86. package/docs/components/quickstart.md +33 -0
  87. package/docs/components/radio.md +256 -0
  88. package/docs/components/rate.md +128 -0
  89. package/docs/components/read.md +163 -0
  90. package/docs/components/readMore.md +227 -0
  91. package/docs/components/resource.md +17 -0
  92. package/docs/components/scrollList.md +218 -0
  93. package/docs/components/search.md +160 -0
  94. package/docs/components/setting.md +111 -0
  95. package/docs/components/settingDesc.md +66 -0
  96. package/docs/components/skeleton.md +105 -0
  97. package/docs/components/skeletons.md +323 -0
  98. package/docs/components/slider.md +157 -0
  99. package/docs/components/steps.md +189 -0
  100. package/docs/components/sticky.md +76 -0
  101. package/docs/components/subsection.md +183 -0
  102. package/docs/components/swipeAction.md +279 -0
  103. package/docs/components/swiper.md +352 -0
  104. package/docs/components/switch.md +216 -0
  105. package/docs/components/tabbar.md +263 -0
  106. package/docs/components/table.md +5 -0
  107. package/docs/components/tabs.md +364 -0
  108. package/docs/components/tag.md +227 -0
  109. package/docs/components/testPic.md +20 -0
  110. package/docs/components/text.md +157 -0
  111. package/docs/components/textarea.md +121 -0
  112. package/docs/components/toast.md +124 -0
  113. package/docs/components/tooltip.md +98 -0
  114. package/docs/components/transition.md +404 -0
  115. package/docs/components/upload.md +253 -0
  116. package/docs/components/vtabs.md +332 -0
  117. package/docs/components/vueUse.md +45 -0
  118. package/docs/components/vuexDetail.md +103 -0
  119. package/docs/components/waterfall.md +651 -0
  120. package/docs/faq/index.md +53 -0
  121. package/docs/guide/codeHint.md +44 -0
  122. package/docs/guide/customIcon.md +168 -0
  123. package/docs/guide/demo.md +92 -0
  124. package/docs/guide/design.md +56 -0
  125. package/docs/guide/globalVariable.md +239 -0
  126. package/docs/guide/i18n.md +194 -0
  127. package/docs/guide/index.md +28 -0
  128. package/docs/guide/note.md +74 -0
  129. package/docs/guide/safeAreaInset.md +64 -0
  130. package/docs/guide/theme.md +67 -0
  131. package/docs/index.md +88 -0
  132. package/libs/config/config.js +0 -10
  133. package/libs/css/color.scss +15 -14
  134. package/package.json +7 -2
  135. package/theme.scss +2 -1
@@ -0,0 +1,141 @@
1
+ ## LineProgress 线形进度条 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/progress/progress"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-line-progress**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-line-progress)
10
+
11
+ :::
12
+
13
+ 该组件是一个线形的进度条,通过参数配置进度,灵活操作当前进度。适用于某个任务的进度等场景。
14
+
15
+ ### 平台兼容性
16
+
17
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
18
+ |:-:|:-:|:-:|:-:|:-:|:-:|
19
+ |√|√|√|√|√|√|
20
+
21
+ ### 基本使用
22
+
23
+ - 通过`percentage`设置当前的进度值,该值区间为0-100
24
+ - 通过`activeColor`设置进度条的颜色
25
+
26
+ ```vue
27
+ <template>
28
+ <uv-line-progress :percentage="30" activeColor="#ff0000"></uv-line-progress>
29
+ </template>
30
+ ```
31
+
32
+ ### 不显示百分比
33
+
34
+ 通过`show-text`属性配置是否显示进度条内百分值
35
+
36
+ ```vue
37
+ <template>
38
+ <uv-line-progress :percentage="30" :showText="false"></uv-line-progress>
39
+ </template>
40
+ ```
41
+
42
+ ### 自定义高度
43
+
44
+ 通过`height`属性设置进度条高度
45
+
46
+ ```vue
47
+ <template>
48
+ <uv-line-progress :percentage="30" height="30"></uv-line-progress>
49
+ </template>
50
+ ```
51
+
52
+ ### 自定义样式(不支持安卓环境的nvue)
53
+
54
+ 自定义的数值样式,需要将数值嵌套在默认插槽里
55
+
56
+ ```vue
57
+ <template>
58
+ <uv-line-progress :percentage="30">
59
+ <text class="uv-percentage-slot">{{30}}%</text>
60
+ </uv-line-progress>
61
+ </template>
62
+ <style lang="scss" scoped>
63
+ .uv-percentage-slot {
64
+ padding: 1px 5px;
65
+ background-color: #f9ae3d;
66
+ color: #fff;
67
+ border-radius: 100px;
68
+ font-size: 10px;
69
+ margin-right: -5px;
70
+ }
71
+ </style>
72
+ ```
73
+
74
+ ### 手动加减
75
+
76
+ 通过`percentage`属性设置数值达到增减
77
+
78
+ ::: warning 温馨提示
79
+ 使用uni上挂载的uv-ui内置方法,需要根据[扩展配置 - JS工具库](/components/setting.html)进行相应的配置,否则直接会报错!
80
+ :::
81
+
82
+ ```vue
83
+ <template>
84
+ <view style="margin-top: 50px;">
85
+ <uv-line-progress :percentage="percentage" />
86
+ <view style="display: flex;margin-top: 100px;">
87
+ <button @click="computedWidth('minus')">减少</button>
88
+ <button @click="computedWidth('plus')">增加</button>
89
+ </view>
90
+ </view>
91
+ </template>
92
+ <script setup>
93
+ import { ref } from 'vue';
94
+
95
+ const percentage = ref(30);
96
+ function computedWidth(type) {
97
+ if (type === 'plus') {
98
+ percentage.value = uni.$uv.range(0, 100, percentage.value + 10);
99
+ } else {
100
+ percentage.value = uni.$uv.range(0, 100, percentage.value - 10);
101
+ }
102
+ }
103
+
104
+ </script>
105
+ ```
106
+
107
+ ### 完整示例
108
+
109
+ ::: tip 完整示例下载地址
110
+
111
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
112
+
113
+ :::
114
+
115
+ ### API
116
+ ---
117
+
118
+ ### LineProgress Props
119
+
120
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
121
+ |:- |:- |:- |:- |:- |
122
+ | activeColor | 进度条激活部分的颜色 | String | #19be6b | - |
123
+ | inactiveColor | 进度条的底色,默认为灰色 | String | #ececec | - |
124
+ | percentage | 进度百分比,数值 | String &#124; Number | 0 | - |
125
+ | showText | 是否在进度条内部显示百分比的值 | Boolean | true | true &#124; false |
126
+ | height | 进度条的高度,默认单位px。eg:`height="30rpx"` | String &#124; Number | 12 | - |
127
+ | customStyle | 自定义外部样式 | Object | - | - |
128
+
129
+
130
+ ### LineProgress Slots
131
+
132
+ | 名称 | 说明 |
133
+ |:- |:- |
134
+ | default | 传入自定义的显示内容,将会覆盖默认显示的百分比值 |
135
+
136
+
137
+ <style scoped>
138
+ h3[id=lineprogress-slots] + table thead tr th:nth-child(2){
139
+ width: 70%;
140
+ }
141
+ </style>
@@ -0,0 +1,89 @@
1
+ ## Link 超链接
2
+
3
+ <demo-model url="/pages/componentsA/link/link"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-link**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-link)
10
+
11
+ :::
12
+
13
+ 该组件为超链接组件,在不同平台有不同表现形式:
14
+ - 在APP平台会通过`plus`环境打开内置浏览器
15
+ - 在小程序中把链接复制到粘贴板,同时提示信息
16
+ - 在H5中通过`window.open`打开链接
17
+
18
+ ### 平台兼容性
19
+
20
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
21
+ |:-:|:-:|:-:|:-:|:-:|:-:|
22
+ |√|√|√|√|√|√|
23
+
24
+ ### 基本使用
25
+
26
+ - 通过`href`设置打开的链接,`text`设置显示的内容
27
+
28
+ ```vue
29
+ <template>
30
+ <uv-link href="https://www.uvui.cn" text="打开uv-ui文档" @click="click"></uv-link>
31
+ </template>
32
+ <script setup>
33
+ function click() {
34
+ console.log('click');
35
+ }
36
+
37
+ </script>
38
+ ```
39
+
40
+ ### 下划线
41
+
42
+ 通过`under-line`设置是否显示链接的下划线
43
+
44
+ ```vue
45
+ <template>
46
+ <uv-link href="https://www.uvui.cn" text="打开uv-ui文档" :under-line="true"></uv-link>
47
+ </template>
48
+ ```
49
+
50
+ ### 自定义颜色
51
+
52
+ - 通过`color`设置文字颜色
53
+ - 通过`line-color`设置下划线颜色
54
+
55
+ ```vue
56
+ <template>
57
+ <uv-link href="https://www.uvui.cn" text="打开uv-ui文档" color="#19be6b" line-color="#19be6b"></uv-link>
58
+ </template>
59
+ ```
60
+
61
+ ### 完整示例
62
+
63
+ ::: tip 完整示例下载地址
64
+
65
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
66
+
67
+ :::
68
+
69
+ ### API
70
+ ---
71
+
72
+ ### Link Props
73
+
74
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
75
+ |:- |:- |:- |:- |:- |
76
+ | color | 文字颜色 | String | - | - |
77
+ | fontSize | 字体大小,默认单位`px(rpx)` | String &#124; Number | 15 | - |
78
+ | underLine | 是否显示下划线 | Boolean | false | true &#124; false |
79
+ | href | 跳转的链接,要带上http(s) | String | - | - |
80
+ | mpTips | 各个小程序平台把链接复制到粘贴板后的提示语 | String | 链接已复制,请在浏览器打开 | - |
81
+ | lineColor | 下划线颜色,默认同`color`参数颜色 | String | - | - |
82
+ | text | 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色 | String | -| -|
83
+
84
+
85
+ ### Link Events
86
+
87
+ |事件名 |说明 |回调参数 |
88
+ |:- |:- |:- |
89
+ | @click | 点击链接时触发 | - |
@@ -0,0 +1,223 @@
1
+ ## List 列表
2
+
3
+ <demo-model url="/pages/componentsC/list/list"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-list > uv-list-item**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-list)
10
+
11
+ :::
12
+
13
+ 重构:<Badge text="1.0.6" />
14
+
15
+ List列表组件,包含基本列表样式、默认插槽机制、可扩展插槽机制、长列表性能优化、多端兼容。
16
+
17
+ 在vue页面里,它默认使用页面级滚动,这样做的目的是性能更加友好。在app-nvue页面里,它默认使用原生list组件滚动,这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。
18
+
19
+ uv-list组件是父容器,里面的核心是uv-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。
20
+
21
+ uv-list-item有很多风格,uv-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容,插槽包括:默认插槽(完全自定义内容)、具名插槽(header | body | footer),根据需求进行扩展。
22
+
23
+ 内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表等,其他不能满足的场景使用插槽进行扩展。
24
+
25
+ uv-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uv-load-more](https://www.uvui.cn/components/loadMore.html)
26
+
27
+ ### 平台兼容性
28
+
29
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
30
+ |:-:|:-:|:-:|:-:|:-:|:-:|
31
+ |√|√|√|√|√|√|
32
+
33
+ ### 基本用法
34
+
35
+ - 设置 `title` 属性,可以显示列表标题
36
+ - 设置 `disabled` 属性,可以禁用当前项
37
+
38
+ ```vue
39
+ <uv-list>
40
+ <uv-list-item title="列表文字" ></uv-list-item>
41
+ <uv-list-item :disabled="true" title="列表禁用状态" ></uv-list-item>
42
+ </uv-list>
43
+ ```
44
+
45
+ ### 多行内容显示
46
+
47
+ - 设置 `note` 属性 ,可以在第二行显示描述文本信息
48
+
49
+ ```vue
50
+ <uv-list>
51
+ <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
52
+ <uv-list-item :disabled="true" title="列表禁用状态" note="列表描述信息"></uv-list-item>
53
+ </uv-list>
54
+ ```
55
+
56
+ ### 右侧显示角标、switch
57
+
58
+ - 设置 `show-badge` 属性是否显示角标,设置 `badge` 属性可以显示角标内容,具体参数参考:[uv-badge](https://www.uvui.cn/components/badge.html)
59
+ - 设置 `show-switch` 属性,可以显示 `switch` 开关
60
+
61
+ ```vue
62
+ <uv-list>
63
+ <uv-list-item title="列表右侧显示角标" :show-badge="true" :badge="{value: '999+'}" ></uv-list-item>
64
+ <uv-list-item title="列表右侧显示 switch" :show-switch="true" @switchChange="switchChange" ></uv-list-item>
65
+ </uv-list>
66
+ ```
67
+
68
+ ### 左侧显示略缩图、图标
69
+
70
+ - 设置 `thumb` 属性 ,可以在列表左侧显示略缩图
71
+ - 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标
72
+
73
+ ```vue
74
+ <uv-list>
75
+ <uv-list-item
76
+ title="列表左侧带略缩图"
77
+ note="列表描述信息"
78
+ thumb="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
79
+ thumb-size="lg"
80
+ rightText="右侧文字">
81
+ </uv-list-item>
82
+ <uv-list-item :show-extra-icon="true" :extra-icon="{icon:'photo',color:'red'}" title="列表左侧带扩展图标">
83
+ </uv-list-item>
84
+ </uv-list>
85
+ ```
86
+ ### 开启点击反馈和右侧箭头
87
+ - 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件
88
+ - 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头
89
+ - 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo`
90
+
91
+ ```vue
92
+ <uv-list>
93
+ <uv-list-item title="开启点击反馈" clickable @click=""></uv-list-item>
94
+ <uv-list-item title="默认 navigateTo 方式跳转页面" link to="/pages/vue/index/index" @click="($event,1)"></uv-list-item>
95
+ <uv-list-item title="reLaunch 方式跳转页面" link="reLaunch" to="/pages/vue/index/index" @click="($event,1)"></uv-list-item>
96
+ </uv-list>
97
+ ```
98
+
99
+ ### 自定义内容
100
+
101
+ ```vue
102
+ <uv-list>
103
+ <uv-list-item>自定义内容1</uv-list-item>
104
+ <uv-list-item>自定义内容2</uv-list-item>
105
+ <uv-list-item>自定义内容3</uv-list-item>
106
+ </uv-list>
107
+ ```
108
+
109
+ ### 完整示例
110
+
111
+ ::: tip 完整示例下载地址
112
+
113
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
114
+
115
+ :::
116
+
117
+ ### API
118
+ ---
119
+
120
+ ### List Props
121
+
122
+ | 参数 | 类型 | 默认值 | 说明 |
123
+ |:-|:-|:-|:-|
124
+ | border | Boolean | false | 是否显示边框 |
125
+ | border-color | String | #dadbde | 边框颜色 |
126
+ | direction | String | row | 控制子组件排版方向,使用默认插槽自定义内容时不生效 |
127
+ | padding | String | '20rpx 30rpx' | 控制子组件内边距,使用默认插槽自定义内容时不生效 |
128
+ | customStyle | Object &#124; String | - | 自定义外部样式 |
129
+
130
+ ### ListItem Props
131
+
132
+ | 参数 | 类型 | 默认值 | 说明 |
133
+ |:-|:-|:-|:-|
134
+ | border | Boolean | false | 是否显示边框 |
135
+ | title | String | - | 标题 |
136
+ | note | String | - | 描述 |
137
+ | ellipsis | Number | 0 | title 是否溢出隐藏省略显示,可选值1-5 |
138
+ | thumb | String | - | 左侧缩略图,若thumb有值,则不会显示扩展图标 |
139
+ | thumb-size | String | medium | 略缩图尺寸,可选值,lg: 大图; medium: 一般; sm: 小图; |
140
+ | show-badge | Boolean | false | 是否显示数字角标 |
141
+ | badge | Object | - | 数字角标参数,[如上示例](/components/list.html#右侧显示角标、switch) ,更多参数:[uv-badge](https://www.uvui.cn/components/badge.html)|
142
+ | right-text | String | - | 右侧文字内容 |
143
+ | disabled | Boolean | false | 是否禁用 |
144
+ | show-arrow | Boolean | true | 是否显示箭头图标 |
145
+ | link | String | navigateTo | 新页面跳转方式,可选值[见下表](/components/list.html#link-props ) |
146
+ | to | String | - | 新页面跳转地址,如填写此属性,click 会返回页面是否跳转成功 |
147
+ | clickable | Boolean | false | 是否开启点击反馈 |
148
+ | show-switch | Boolean | false | 是否显示Switch |
149
+ | switch-checked | Boolean | false | Switch是否被选中 |
150
+ | show-extra-icon | Boolean | false | 左侧是否显示扩展图标 |
151
+ | extra-icon | Object | - | 扩展图标参数,格式为 {color: '#4cd964',size: '22',name: 'photo'},参考 [uv-icon](https://www.uvui.cn/components/icon.html) |
152
+ | direction | String | row | 排版方向,可选值,row:水平排列; column:垂直排列; 3个插槽是水平排还是垂直排,也受此属性控制 |
153
+ | customStyle | Object &#124; String | - | 自定义外部样式 |
154
+
155
+ #### Link Options
156
+
157
+ | 属性名 | 说明 |
158
+ |:-|:-|
159
+ | navigateTo | 同 uni.navigateTo() |
160
+ | redirectTo | 同 uni.reLaunch() |
161
+ | reLaunch | 同 uni.reLaunch() |
162
+ | switchTab | 同 uni.switchTab() |
163
+
164
+
165
+ ### List Events
166
+
167
+ | 事件名 | 说明 |返回参数 |
168
+ |:- |:- |:- |
169
+ | @scroll | nvue模式,滚动时触发 | e |
170
+ | @scrolltolower | nvue模式,滚动到底部触发 | - |
171
+
172
+ ### ListItem Events
173
+
174
+ | 事件名 | 说明 |返回参数 |
175
+ |:- |:- |:- |
176
+ | @click | 点击 uv-list-item 触发事件,需开启点击反馈::clickable="true" | - |
177
+ | @switchChange | 点击切换 Switch 时触发,需显示 switch | e={value:checked} |
178
+
179
+ ### ListItem Slots
180
+ |名称 | 说明 |
181
+ |:- |:- |
182
+ | default | 默认插槽,完全自定义内容时推荐该方式,示例如上:[自定义内容](/components/list.html#自定义内容) |
183
+ | header | 左/上内容插槽,可完全自定义默认显示 |
184
+ | body | 中间内容插槽,可完全自定义中间内容 |
185
+ | footer | 右/下内容插槽,可完全自定义右侧内容 |
186
+
187
+ <style scoped>
188
+ h3[id=list-props] + table thead tr th:nth-child(1),
189
+ h3[id=list-props] + table thead tr th:nth-child(2),
190
+ h3[id=list-props] + table thead tr th:nth-child(3)
191
+ {
192
+ width: 18%;
193
+ }
194
+ h3[id=listitem-props] + table thead tr th:nth-child(1),
195
+ h3[id=listitem-props] + table thead tr th:nth-child(2),
196
+ h3[id=listitem-props] + table thead tr th:nth-child(3)
197
+ {
198
+ width: 18%;
199
+ }
200
+ h4[id=link-options] + table {
201
+ width: 40%;
202
+ }
203
+ h4[id=link-options] + table thead tr th:nth-child(1),
204
+ h4[id=link-options] + table thead tr th:nth-child(2)
205
+ {
206
+ width: 50%;
207
+ }
208
+ h3[id=listitem-events] + table thead tr th:nth-child(1),
209
+ h3[id=list-events] + table thead tr th:nth-child(1) {
210
+ width: 20%;
211
+ }
212
+ h3[id=listitem-events] + table thead tr th:nth-child(2),
213
+ h3[id=listitem-events] + table thead tr th:nth-child(3),
214
+ h3[id=list-events] + table thead tr th:nth-child(2),
215
+ h3[id=list-events] + table thead tr th:nth-child(3)
216
+ {
217
+ width: 40%;
218
+ }
219
+ h3[id=listitem-slots] + table thead tr th:nth-child(2)
220
+ {
221
+ width: 80%;
222
+ }
223
+ </style>
@@ -0,0 +1,140 @@
1
+ ## LoadMore 加载更多 <to-api/>
2
+
3
+ <demo-model url="/pages/componentsD/loadmore/loadmore"></demo-model>
4
+
5
+ ::: tip ✈
6
+
7
+ **组件名:uv-load-more**
8
+
9
+ [点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-load-more)
10
+
11
+ :::
12
+
13
+ 此组件一般用于标识页面底部加载数据时的状态,共有三种状态:
14
+ - `loadmore` 加载前,显示“加载更多”。该状态下提供点击回调`@loadmore`,在数据不够一页时,无法触发页面的`onReachBottom`生命周期,可使用该回调进行下一步操作
15
+ - `loading` 加载中,显示“正在加载...”
16
+ - 加载后,如果还有数据,回到“加载前”`loadmore`状态,否则加载结束,显示“没有更多了”`nomore`状态
17
+
18
+ ### 平台兼容性
19
+
20
+ |App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
21
+ |:-:|:-:|:-:|:-:|:-:|:-:|
22
+ |√|√|√|√|√|√|
23
+
24
+ ### 基本使用
25
+
26
+ - 通过`status`设置组件的状态,`loadmore` - 加载前,`loading` - 加载中,`nomore` - 没有数据
27
+
28
+ - **注意:** 以下示例仅为模拟效果,实际中请根据自己的逻辑,修改代码的实现
29
+
30
+ ```vue
31
+ <template>
32
+ <view class="wrap">
33
+ <view class="item uv-border-bottom" v-for="(item, index) in list" :key="index">{{'第' + item + '条数据'}}</view>
34
+ <uv-load-more :status="status" />
35
+ </view>
36
+ </template>
37
+ <script setup>
38
+ import { ref } from 'vue';
39
+
40
+ const status = ref('loadmore');
41
+ const list = ref(15);
42
+ const page = ref(0);
43
+
44
+ </script>
45
+ <style lang="scss" scoped>
46
+ .wrap {
47
+ padding: 24rpx;
48
+ }
49
+ .item {
50
+ padding: 24rpx 0;
51
+ color: #222;
52
+ font-size: 28rpx;
53
+ }
54
+ </style>
55
+ ```
56
+
57
+ ### 控制组件的提示以及动画效果
58
+
59
+ - 设置`loadmore-text`属性配置`加载前`提示的文字;设置`loading-text`属性配置`加载中`提示的文字;设置`nomore-text`属性配置`无数据`提示的文字
60
+ - 设置`:is-dot="true"`,在没有数据时,内容显示为一个“●”替代默认的“没有更多了”
61
+
62
+ ```vue
63
+ <template>
64
+ <uv-load-more :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
65
+ </template>
66
+ <script setup>
67
+ import { ref } from 'vue';
68
+
69
+ const status = ref('loadmore');
70
+ const loadingText = ref('努力加载中');
71
+ const loadmoreText = ref('轻轻上拉');
72
+ const nomoreText = ref('实在没有了');
73
+
74
+ </script>
75
+ ```
76
+ ### 线条自定义颜色和设置为虚线
77
+
78
+ 设置`dashed`和`lineColor`属性实现,见如下:
79
+
80
+ ```vue
81
+ <template>
82
+ <uv-load-more loadmoreText="看,我和别人不一样" color="#1CD29B" lineColor="#1CD29B" dashed line />
83
+ </template>
84
+ ```
85
+
86
+
87
+ ### 手动触发加载更多
88
+
89
+ 有时候可能会因为网络,或者数据不满一页的原因,导致无法上拉触发`onReachBottom`生命周期,这时候(需`status`为`loadmore`状态),用户点击组件,就会触发`loadmore`
90
+ 事件。可以在回调中,进行状态的控制和数据的加载,同时也可以修改`loadText`的`loadmore`为“上拉或点击加载更多”进行更加人性化的提示。
91
+
92
+
93
+ ### 完整示例
94
+
95
+ ::: tip 完整示例下载地址
96
+
97
+ [https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
98
+
99
+ :::
100
+
101
+ ### API
102
+ ---
103
+
104
+ ### LoadMore Props
105
+
106
+ | 参数 | 说明 | 类型 | 默认值 | 可选值 |
107
+ | :- | :- | :- | :- | :- |
108
+ | status | 组件状态 | String | loadmore | loadmore &#124; loading &#124; nomore |
109
+ | bgColor | 组件背景颜色,在页面是非白色时会用到(默认`transparent`) | String | transparent | - |
110
+ | icon | 加载中时是否显示图标 | Boolean | true | true &#124; false |
111
+ | fontSize | 字体大小,单位`rpx`或`px` | String &#124; Number | 14 | - |
112
+ | iconSize | 图标大小,单位`rpx`或`px` | String &#124; Number | 17 | - |
113
+ | color | 字体颜色 | String | #606266 | - |
114
+ | loadingIcon | 加载中状态的图标,详情可参考[模式类型](https://www.uvui.cn/components/loadingIcon.html#模式类型) | String | spinner | spinner &#124; circle &#124; semicircle |
115
+ | loadmoreText | 加载前的提示语 | String | 加载更多 | - |
116
+ | loadingText | 加载中提示语 | String | 正在加载... | - |
117
+ | nomoreText | 没有更多的提示语 | String | 没有更多了 | - |
118
+ | isDot | `status`为`nomore`时,内容显示为一个"●" | Boolean | false | true &#124; false |
119
+ | iconColor | 加载中的动画图标的颜色 | String | #b7b7b7 | - |
120
+ | lineColor | 线条颜色 | String | #E6E8EB | - |
121
+ | dashed | 是否虚线,false-实线,true-虚线 | Boolean | false | true &#124; false |
122
+ | marginTop | 与前一个元素的距离,单位`rpx`或`px` | String &#124; Number | 10 | - |
123
+ | marginBottom | 与后一个元素的距离,单位`rpx`或`px` | String &#124; Number | 10 | - |
124
+ | height | 高度 | String &#124; Number | auto | - |
125
+ | line | 是否显示左边分割线 | Boolean | false | true &#124; false |
126
+ | customStyle | 自定义外部样式 | Object | - | - |
127
+
128
+
129
+ ### LoadMore Events
130
+
131
+
132
+ | 事件名 | 说明 | 回调参数 |
133
+ | :- | :- | :- |
134
+ | @loadmore | `status`为`loadmore`时,点击组件触发 | - |
135
+
136
+ <style scoped>
137
+ h3[id=loadmore-events] + table thead tr th:nth-child(2){
138
+ width: 40%;
139
+ }
140
+ </style>