@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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +95 -141
- package/docs/api/configs/color.md +52 -0
- package/docs/api/index.md +77 -0
- package/docs/api/mixins/mpShare.md +95 -0
- package/docs/api/request/apiManage.md +88 -0
- package/docs/api/request/http.md +451 -0
- package/docs/api/utils/colorSwitch.md +78 -0
- package/docs/api/utils/debounce.md +104 -0
- package/docs/api/utils/fastUse.md +246 -0
- package/docs/api/utils/getRect.md +238 -0
- package/docs/api/utils/guid.md +41 -0
- package/docs/api/utils/index.md +55 -0
- package/docs/api/utils/intro.md +25 -0
- package/docs/api/utils/object.md +171 -0
- package/docs/api/utils/queryParams.md +68 -0
- package/docs/api/utils/random.md +23 -0
- package/docs/api/utils/randomArray.md +28 -0
- package/docs/api/utils/route.md +121 -0
- package/docs/api/utils/test.md +237 -0
- package/docs/api/utils/time.md +81 -0
- package/docs/api/utils/trim.md +24 -0
- package/docs/components/actionSheet.md +236 -0
- package/docs/components/addQQGroup.md +5 -0
- package/docs/components/album.md +91 -0
- package/docs/components/alert.md +83 -0
- package/docs/components/avatar.md +152 -0
- package/docs/components/backTop.md +181 -0
- package/docs/components/badge.md +117 -0
- package/docs/components/button.md +196 -0
- package/docs/components/calendar.md +398 -0
- package/docs/components/calendars.md +294 -0
- package/docs/components/cell.md +185 -0
- package/docs/components/checkbox.md +281 -0
- package/docs/components/circleProgress.md +5 -0
- package/docs/components/code.md +162 -0
- package/docs/components/codeInput.md +175 -0
- package/docs/components/collapse.md +250 -0
- package/docs/components/color.md +324 -0
- package/docs/components/common.md +126 -0
- package/docs/components/countDown.md +166 -0
- package/docs/components/countTo.md +140 -0
- package/docs/components/datetimePicker.md +283 -0
- package/docs/components/diff1.x.md +190 -0
- package/docs/components/divider.md +88 -0
- package/docs/components/downloadSetting.md +54 -0
- package/docs/components/dropDown.md +375 -0
- package/docs/components/empty.md +99 -0
- package/docs/components/feature.md +261 -0
- package/docs/components/form.md +736 -0
- package/docs/components/gap.md +49 -0
- package/docs/components/grid.md +225 -0
- package/docs/components/icon.md +101 -0
- package/docs/components/image.md +182 -0
- package/docs/components/index.md +110 -0
- package/docs/components/indexList.md +133 -0
- package/docs/components/input.md +250 -0
- package/docs/components/install.md +59 -0
- package/docs/components/intro.md +32 -0
- package/docs/components/keyboard.md +226 -0
- package/docs/components/layout.md +310 -0
- package/docs/components/line.md +85 -0
- package/docs/components/lineProgress.md +141 -0
- package/docs/components/link.md +89 -0
- package/docs/components/list.md +223 -0
- package/docs/components/loadMore.md +140 -0
- package/docs/components/loadingIcon.md +144 -0
- package/docs/components/loadingPage.md +92 -0
- package/docs/components/modal.md +230 -0
- package/docs/components/more.md +13 -0
- package/docs/components/navbar.md +192 -0
- package/docs/components/noNetwork.md +116 -0
- package/docs/components/noticeBar.md +131 -0
- package/docs/components/notify.md +204 -0
- package/docs/components/npmSetting.md +64 -0
- package/docs/components/numberBox.md +257 -0
- package/docs/components/nvue.md +170 -0
- package/docs/components/overlay.md +117 -0
- package/docs/components/parse.md +204 -0
- package/docs/components/pickColor.md +112 -0
- package/docs/components/picker.md +357 -0
- package/docs/components/popup.md +221 -0
- package/docs/components/problem.md +300 -0
- package/docs/components/qrcode.md +169 -0
- package/docs/components/quickstart.md +33 -0
- package/docs/components/radio.md +256 -0
- package/docs/components/rate.md +128 -0
- package/docs/components/read.md +163 -0
- package/docs/components/readMore.md +227 -0
- package/docs/components/resource.md +17 -0
- package/docs/components/scrollList.md +218 -0
- package/docs/components/search.md +160 -0
- package/docs/components/setting.md +111 -0
- package/docs/components/settingDesc.md +66 -0
- package/docs/components/skeleton.md +105 -0
- package/docs/components/skeletons.md +323 -0
- package/docs/components/slider.md +157 -0
- package/docs/components/steps.md +189 -0
- package/docs/components/sticky.md +76 -0
- package/docs/components/subsection.md +183 -0
- package/docs/components/swipeAction.md +279 -0
- package/docs/components/swiper.md +352 -0
- package/docs/components/switch.md +216 -0
- package/docs/components/tabbar.md +263 -0
- package/docs/components/table.md +5 -0
- package/docs/components/tabs.md +364 -0
- package/docs/components/tag.md +227 -0
- package/docs/components/testPic.md +20 -0
- package/docs/components/text.md +157 -0
- package/docs/components/textarea.md +121 -0
- package/docs/components/toast.md +124 -0
- package/docs/components/tooltip.md +98 -0
- package/docs/components/transition.md +404 -0
- package/docs/components/upload.md +253 -0
- package/docs/components/vtabs.md +332 -0
- package/docs/components/vueUse.md +45 -0
- package/docs/components/vuexDetail.md +103 -0
- package/docs/components/waterfall.md +651 -0
- package/docs/faq/index.md +53 -0
- package/docs/guide/codeHint.md +44 -0
- package/docs/guide/customIcon.md +168 -0
- package/docs/guide/demo.md +92 -0
- package/docs/guide/design.md +56 -0
- package/docs/guide/globalVariable.md +239 -0
- package/docs/guide/i18n.md +194 -0
- package/docs/guide/index.md +28 -0
- package/docs/guide/note.md +74 -0
- package/docs/guide/safeAreaInset.md +64 -0
- package/docs/guide/theme.md +67 -0
- package/docs/index.md +88 -0
- package/libs/config/config.js +0 -10
- package/libs/css/color.scss +15 -14
- package/package.json +7 -2
- package/theme.scss +2 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
## 快速上手
|
|
2
|
+
|
|
3
|
+
<demo-model url="/"></demo-model>
|
|
4
|
+
|
|
5
|
+
本节将介绍如何在项目中使用 uv-ui。
|
|
6
|
+
|
|
7
|
+
### 如何使用
|
|
8
|
+
|
|
9
|
+
通过[下载安装](/components/install.html)之后,**无需**通过`import`引入组件,在页面中即可直接使用。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### 快速开始
|
|
14
|
+
|
|
15
|
+
**1. 首先进行[下载安装](/components/install.html)** 组件库
|
|
16
|
+
|
|
17
|
+
<!-- 温馨提示:导入插件后,建议`HBuilderX`重新运行项目,可能新导入的插件不能实时更新而导致不能运行。 -->
|
|
18
|
+
|
|
19
|
+
**2. 无需通过import引入组件,直接在项目中使用**
|
|
20
|
+
|
|
21
|
+
注意:如果您是npm下载的组件,需要[esaycom配置](/components/install.html#npm-方式)即可正常使用。
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<uv-icon name="photo" size="30" color="#909399"></uv-icon>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**3. 使用更强大的扩展功能**
|
|
28
|
+
|
|
29
|
+
`uv-ui`内置了强大的工具函数、请求封装、全局配置等,可以根据自身需求进行扩展配置,详情请查看[扩展配置](/components/setting.html)。
|
|
30
|
+
|
|
31
|
+
**4. 建议App.vue中引入基础样式**
|
|
32
|
+
|
|
33
|
+
这样做的目的,请参考[扩展配置-基础样式](/components/setting.html#扩展配置-基础样式),有相关说明。
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
## Radio 单选框 <to-api/>
|
|
2
|
+
|
|
3
|
+
<demo-model url="/pages/componentsB/radio/radio"></demo-model>
|
|
4
|
+
|
|
5
|
+
::: tip ✈
|
|
6
|
+
|
|
7
|
+
**组件名:uv-radio-group > uv-radio**
|
|
8
|
+
|
|
9
|
+
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-radio)
|
|
10
|
+
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
单选框用于有一个选择,用户只能选择其中一个的场景。
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 平台兼容性
|
|
17
|
+
|
|
18
|
+
|App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
|
|
19
|
+
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|
20
|
+
|√|√|√|√|√|√|
|
|
21
|
+
|
|
22
|
+
### 基本使用
|
|
23
|
+
|
|
24
|
+
- 该组件需要搭配`radioGroup`组件使用,以便用户进行操作时,获得当前单选框组的选中情况
|
|
25
|
+
- 通过`v-model`给`radioGroup`组件绑定一个变量,对应的` name`将会被选中
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<template>
|
|
29
|
+
<uv-radio-group v-model="radiovalue">
|
|
30
|
+
<uv-radio
|
|
31
|
+
:customStyle="{margin: '8px'}"
|
|
32
|
+
v-for="(item, index) in radiolist"
|
|
33
|
+
:key="index"
|
|
34
|
+
:label="item.name"
|
|
35
|
+
:name="item.name">
|
|
36
|
+
</uv-radio>
|
|
37
|
+
</uv-radio-group>
|
|
38
|
+
</template>
|
|
39
|
+
<script setup>
|
|
40
|
+
import { ref } from 'vue';
|
|
41
|
+
|
|
42
|
+
const radiolist = ref([{
|
|
43
|
+
name: '苹果',
|
|
44
|
+
disabled: false
|
|
45
|
+
}, {
|
|
46
|
+
name: '香蕉',
|
|
47
|
+
disabled: false
|
|
48
|
+
}, {
|
|
49
|
+
name: '橙子',
|
|
50
|
+
disabled: false
|
|
51
|
+
}, {
|
|
52
|
+
name: '榴莲',
|
|
53
|
+
disabled: false
|
|
54
|
+
}]);
|
|
55
|
+
const radiovalue = ref('苹果');
|
|
56
|
+
|
|
57
|
+
</script>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### 自定义形状
|
|
62
|
+
|
|
63
|
+
可以通过设置`shape`为`square`或者`circle`,将单选框设置为方形或者圆形
|
|
64
|
+
|
|
65
|
+
```vue
|
|
66
|
+
<template>
|
|
67
|
+
<uv-radio-group v-model="radiovalue">
|
|
68
|
+
<uv-radio
|
|
69
|
+
shape="square"
|
|
70
|
+
:customStyle="{margin: '8px'}"
|
|
71
|
+
v-for="(item, index) in radiolist"
|
|
72
|
+
:key="index"
|
|
73
|
+
:label="item.name"
|
|
74
|
+
:name="item.name">
|
|
75
|
+
</uv-radio>
|
|
76
|
+
</uv-radio-group>
|
|
77
|
+
</template>
|
|
78
|
+
<script setup>
|
|
79
|
+
import { ref } from 'vue';
|
|
80
|
+
|
|
81
|
+
const radiolist = ref([{
|
|
82
|
+
name: '苹果',
|
|
83
|
+
disabled: false
|
|
84
|
+
}, {
|
|
85
|
+
name: '香蕉',
|
|
86
|
+
disabled: false
|
|
87
|
+
}]);
|
|
88
|
+
const radiovalue = ref('苹果');
|
|
89
|
+
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 禁用radio
|
|
94
|
+
|
|
95
|
+
设置`disabled`为`true`,即可禁用某个组件,让用户无法点击
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<template>
|
|
99
|
+
<uv-radio-group v-model="radiovalue">
|
|
100
|
+
<uv-radio :disabled="true" name="苹果" label="苹果"></uv-radio>
|
|
101
|
+
<uv-radio :disabled="true" name="梨子" label="梨子"></uv-radio>
|
|
102
|
+
<uv-radio :disabled="false" name="香蕉" label="香蕉"></uv-radio>
|
|
103
|
+
</uv-radio-group>
|
|
104
|
+
</template>
|
|
105
|
+
<script setup>
|
|
106
|
+
import { ref } from 'vue';
|
|
107
|
+
|
|
108
|
+
const radiovalue = ref('苹果');
|
|
109
|
+
|
|
110
|
+
</script>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 自定义颜色
|
|
114
|
+
|
|
115
|
+
此处所指的颜色,为`radio`选中时的背景颜色,参数为`activeColor`
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<template>
|
|
119
|
+
<uv-radio-group v-model="radiovalue">
|
|
120
|
+
<uv-radio name="苹果" label="苹果"></uv-radio>
|
|
121
|
+
<uv-radio name="香蕉" activeColor="red" label="香蕉"></uv-radio>
|
|
122
|
+
</uv-radio-group>
|
|
123
|
+
</template>
|
|
124
|
+
<script setup>
|
|
125
|
+
import { ref } from 'vue';
|
|
126
|
+
|
|
127
|
+
const radiovalue = ref('香蕉');
|
|
128
|
+
|
|
129
|
+
</script>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 横向排列形式
|
|
133
|
+
|
|
134
|
+
可以通过设置`placement`为`row`或者`column`,将复选框设置为横向排列或者竖向排列
|
|
135
|
+
|
|
136
|
+
```vue
|
|
137
|
+
<template>
|
|
138
|
+
<uv-radio-group v-model="radiovalue" placement="column">
|
|
139
|
+
<uv-radio name="苹果" label="苹果"></uv-radio>
|
|
140
|
+
<uv-radio name="香蕉" activeColor="red" label="香蕉"></uv-radio>
|
|
141
|
+
</uv-radio-group>
|
|
142
|
+
</template>
|
|
143
|
+
<script setup>
|
|
144
|
+
import { ref } from 'vue';
|
|
145
|
+
|
|
146
|
+
const radiovalue = ref('香蕉');
|
|
147
|
+
|
|
148
|
+
</script>
|
|
149
|
+
```
|
|
150
|
+
### 横向两端排列形式
|
|
151
|
+
|
|
152
|
+
在`placement="column"`前提下,可以通过设置`iconPlacement`为`left`或者`right`,将复选框勾选图标的对齐设置为左对齐或者右对齐
|
|
153
|
+
|
|
154
|
+
```vue
|
|
155
|
+
<template>
|
|
156
|
+
<uv-radio-group
|
|
157
|
+
v-model="radiovalue"
|
|
158
|
+
placement="column"
|
|
159
|
+
iconPlacement="right">
|
|
160
|
+
<uv-radio name="苹果" label="苹果"></uv-radio>
|
|
161
|
+
<uv-radio name="香蕉" label="香蕉"></uv-radio>
|
|
162
|
+
</uv-radio-group>
|
|
163
|
+
</template>
|
|
164
|
+
<script setup>
|
|
165
|
+
import { ref } from 'vue';
|
|
166
|
+
|
|
167
|
+
const radiovalue = ref('香蕉');
|
|
168
|
+
|
|
169
|
+
</script>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 完整示例
|
|
173
|
+
|
|
174
|
+
::: tip 完整示例下载地址
|
|
175
|
+
|
|
176
|
+
[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
|
177
|
+
|
|
178
|
+
:::
|
|
179
|
+
|
|
180
|
+
### API
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### RadioGroup Props
|
|
184
|
+
|
|
185
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
186
|
+
| :- | :- | :- | :- | :- |
|
|
187
|
+
| value / v-model | 选中 name 的值 | String | Number | Boolean | - | - |
|
|
188
|
+
| disabled | 是否禁用全部checkbox | Boolean | false | true | false |
|
|
189
|
+
| shape | 形状,circle - 圆形,square - 方形 | String | circle | circle | square|
|
|
190
|
+
| activeColor | 选中状态下的颜色,如子`Checkbox`组件设置此值,将会覆盖本值 | String | #2979ff | - |
|
|
191
|
+
| inactiveColor | 未选中的颜色 | String | #c8c9cc | - |
|
|
192
|
+
| name | 标识符 | String | - | - |
|
|
193
|
+
| size | 整个组件的尺寸,默认px。**注意:该参数和iconSize应该同步设置,才能改变选框大小** | String | Number | 18 | - |
|
|
194
|
+
| placement | 布局方式,row - 横向,column - 纵向 | String | row | row | column|
|
|
195
|
+
| label | 文本 | String | - | - |
|
|
196
|
+
| labelColor | label的字体颜色 | String | #303133 | - |
|
|
197
|
+
| labelSize | label的字体大小,单位`px(rpx)` | String | Number | 14 | - |
|
|
198
|
+
| labelDisabled | 是否禁止点击文本操作 | Boolean | false | true | false |
|
|
199
|
+
| iconColor | 图标颜色 | String | #ffffff | - |
|
|
200
|
+
| iconSize | 图标的大小,单位`px(rpx)` | String | Number | 12 | - |
|
|
201
|
+
| borderBottom | 竖向配列时,是否显示下划线 | Boolean | false | true | false |
|
|
202
|
+
| iconPlacement | 勾选图标的对齐方式,left - 左边,right - 右边 | String | left | left | right |
|
|
203
|
+
| customStyle | 自定义样式,某些事件需要用到调整位置等作用 | Object | - | - |
|
|
204
|
+
|
|
205
|
+
### Radio Props
|
|
206
|
+
|
|
207
|
+
注意:`radio`和`radio-group`二者同名参数中,`radio`的参数优先级更高。
|
|
208
|
+
|
|
209
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
210
|
+
| :- | :- | :- | :- | :- |
|
|
211
|
+
| name | radio的名称 | String | Number | Boolean | - | - |
|
|
212
|
+
| shape | 形状,square为方形,circle为圆型 | String | circle| circle | square |
|
|
213
|
+
| disabled | 是否禁用 | Boolean | - | - |
|
|
214
|
+
| labelDisabled | 是否禁止点击提示语选中复选框 | String | Boolean | - | - |
|
|
215
|
+
| activeColor | 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 | String | - | - |
|
|
216
|
+
| inactiveColor | 未选中的颜色 | String | - | - |
|
|
217
|
+
| iconSize | 图标的大小,单位`px(rpx)` | String | Number | - | - |
|
|
218
|
+
| labelSize | label的字体大小,单位`px(rpx)` | String | Number | - | - |
|
|
219
|
+
| label | label提示文字。如果文本较长存在文本不换行的问题,使用customStyle设置一个宽度即可,eg:`customStyle="maxWidth: 300rpx;"` | String | Number | - | - |
|
|
220
|
+
| size | 整体的大小 | String | Number | - | - |
|
|
221
|
+
| iconColor | 图标颜色 | String | - | - |
|
|
222
|
+
| labelColor | label的颜色 | String | - | - |
|
|
223
|
+
| customStyle | 自定义样式 | Object | String | - | - |
|
|
224
|
+
|
|
225
|
+
### Radio Slots
|
|
226
|
+
|
|
227
|
+
| 名称 | 说明 |
|
|
228
|
+
|:- |:- |
|
|
229
|
+
| default | 自定义`label`内容,自定义后,`labelDisabled`设置将会失效 |
|
|
230
|
+
| icon | 自定义选中图标 |
|
|
231
|
+
|
|
232
|
+
### RadioGroup Events
|
|
233
|
+
|
|
234
|
+
| 事件名 | 说明 | 回调参数 |
|
|
235
|
+
| :- | :- | :- |
|
|
236
|
+
| @change| 任一个`radio`状态发生变化时触发 | name: 值为`radio`通过`props`传递的`name`值 |
|
|
237
|
+
|
|
238
|
+
### Radio Events
|
|
239
|
+
|
|
240
|
+
| 事件名 | 说明 | 回调参数 |
|
|
241
|
+
| :- | :- | :- |
|
|
242
|
+
| @change| 某个`radio`状态发生变化时触发(选中状态) | name: 通过`props`传递的`name`参数 |
|
|
243
|
+
|
|
244
|
+
<style>
|
|
245
|
+
h3[id=radio-slots] + table thead tr th:nth-child(2){
|
|
246
|
+
width: 70%;
|
|
247
|
+
}
|
|
248
|
+
h3[id=radiogroup-events] + table thead tr th:nth-child(2),
|
|
249
|
+
h3[id=radio-events] + table thead tr th:nth-child(2) {
|
|
250
|
+
width: 40%;
|
|
251
|
+
}
|
|
252
|
+
h3[id=radiogroup-events] + table thead tr th:nth-child(3),
|
|
253
|
+
h3[id=radio-events] + table thead tr th:nth-child(3) {
|
|
254
|
+
width: 40%;
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
## Rate 评分 <to-api/>
|
|
2
|
+
|
|
3
|
+
<demo-model url="/pages/componentsB/rate/rate"></demo-model>
|
|
4
|
+
|
|
5
|
+
::: tip ✈
|
|
6
|
+
|
|
7
|
+
**组件名:uv-rate**
|
|
8
|
+
|
|
9
|
+
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-rate)
|
|
10
|
+
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
该组件一般用于星级打分评价,比如网上购买产品后进行评价等场景。
|
|
14
|
+
|
|
15
|
+
### 平台兼容性
|
|
16
|
+
|
|
17
|
+
|App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
|
|
18
|
+
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|
19
|
+
|√|√|√|√|√|√|
|
|
20
|
+
|
|
21
|
+
### 基本使用
|
|
22
|
+
|
|
23
|
+
- 通过`count`参数设置总共有多少颗星星可选择
|
|
24
|
+
- 通过`v-model`双向绑定初始化时默认选中的星星数量
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<template>
|
|
28
|
+
<uv-rate :count="count" v-model="value"></uv-rate>
|
|
29
|
+
</template>
|
|
30
|
+
<script setup>
|
|
31
|
+
import { ref } from 'vue';
|
|
32
|
+
|
|
33
|
+
const count = ref(4);
|
|
34
|
+
const value = ref(2);
|
|
35
|
+
|
|
36
|
+
</script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 自定义样式
|
|
40
|
+
|
|
41
|
+
- 通过`active-color`设置选中的星星的颜色
|
|
42
|
+
- 通过`inactive-color`设置未选中时星星的颜色
|
|
43
|
+
- 通过`gutter`设置星星的间距,左右内边距各占`gutter`的一半
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<uv-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20"></uv-rate>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 自定义图标
|
|
50
|
+
|
|
51
|
+
- 通过`inactive-icon`设置未激活的图标
|
|
52
|
+
- 通过`active-icon`设置激活的图标
|
|
53
|
+
|
|
54
|
+
下方示例为使用心形图标替代默认的星星图标:
|
|
55
|
+
|
|
56
|
+
```vue
|
|
57
|
+
<uv-rate activeIcon="heart-fill" inactiveIcon="heart"></uv-rate>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 最少选中的数量
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<uv-rate :minCount="5"></uv-rate>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 禁用状态
|
|
67
|
+
|
|
68
|
+
禁用下,无法点击或者滑动选择,但是可以通过`value`设置默认选中的数量,禁用状态下用来展示分数,允许出现半星
|
|
69
|
+
|
|
70
|
+
```vue
|
|
71
|
+
<uv-rate :value="3.7" disabled></uv-rate>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 只读状态
|
|
75
|
+
|
|
76
|
+
只读状态无法点击或者滑动选择,但是可以通过`value`设置默认选中的数量,禁用状态下用来展示分数,允许出现半星
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<uv-rate :value="3.7" readonly></uv-rate>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 完整示例
|
|
83
|
+
|
|
84
|
+
::: tip 完整示例下载地址
|
|
85
|
+
|
|
86
|
+
[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
|
87
|
+
|
|
88
|
+
:::
|
|
89
|
+
|
|
90
|
+
### API
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Rate Props
|
|
94
|
+
|
|
95
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
96
|
+
|:- |:- |:- |:- |:- |
|
|
97
|
+
| value / v-model | 双向绑定选择星星的数量 | String | Number | 1 | - |
|
|
98
|
+
| count | 最多可选的星星数量 | String | Number | 5 | - |
|
|
99
|
+
| disabled | 是否禁止用户操作 | Boolean | false | true | false |
|
|
100
|
+
| readonly | 是否只读 | Boolean | false | true | false |
|
|
101
|
+
| size | 星星的大小,单位rpx | String | Number | 18 | - |
|
|
102
|
+
| inactiveColor | 未选中星星的颜色 | String | #b2b2b2 | - |
|
|
103
|
+
| activeColor | 选中的星星颜色 | String | #FA3534 | - |
|
|
104
|
+
| gutter | 星星之间的距离 | String | Number | 4 | - |
|
|
105
|
+
| minCount | 最少选中星星的个数 | String | Number | 1 | - |
|
|
106
|
+
| allowHalf | 是否允许半星选择,仅vue生效 | Boolean | false | true | false |
|
|
107
|
+
| activeIcon | 选中时的图标名,只能为uv-ui的内置图标 | String | star-fill | - |
|
|
108
|
+
| inactiveIcon | 未选中时的图标名,只能为uv-ui的内置图标 | String | star | - |
|
|
109
|
+
| touchable | 是否可以通过滑动手势选择评分 | Boolean | true | true | false |
|
|
110
|
+
|
|
111
|
+
<!-- | colors | 颜色分级显示,可以用不同颜色区分评分层级 | Array | - | - | -->
|
|
112
|
+
<!-- | icons | 图标分级显示,可以用不同类型的icon区分评分层级 | Array | - | - | -->
|
|
113
|
+
|
|
114
|
+
### Rate Events
|
|
115
|
+
|
|
116
|
+
| 事件名 | 说明 | 回调参数 |
|
|
117
|
+
| :- | :- | :- |
|
|
118
|
+
| @change | 选中的星星发生变化时触发 | value:当前选中的星星的数量,如果使用`v-model`双向绑定方式,无需监听此事件|
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
h3[id=rate-events] + table thead tr th:nth-child(2){
|
|
122
|
+
width: 42%;
|
|
123
|
+
}
|
|
124
|
+
h3[id=rate-events] + table thead tr th:nth-child(3){
|
|
125
|
+
width: 42%;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
128
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<span> </span><img alt="logo" src="https://www.uvui.cnhttps://www.uvui.cn/common/logo.png" width="120" height="120">
|
|
3
|
+
</p>
|
|
4
|
+
<h3 align="center">uv-ui</h3>
|
|
5
|
+
<h3 align="center">面向 Vue 3 的多平台快速开发 UI 框架</h3>
|
|
6
|
+
|
|
7
|
+
[](https://gitee.com/climblee/uv-ui)
|
|
8
|
+
[](https://gitee.com/climblee/uv-ui)
|
|
9
|
+
[](https://github.com/climblee/uv-ui)
|
|
10
|
+
[](https://github.com/climblee/uv-ui/issues)
|
|
11
|
+
[](https://www.uvui.cn)
|
|
12
|
+
[](https://www.uvui.cn/components/changelog.html)
|
|
13
|
+
[](https://en.wikipedia.org/wiki/MIT_License)
|
|
14
|
+
|
|
15
|
+
## 温馨提示:如需下载uv-ui示例项目,请不要使用【下载插件ZIP】按钮。
|
|
16
|
+
|
|
17
|
+
### uvui官方群1:<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=aaoyDvfV7nSee9vzWfzyZM1vKlu3xrNZ&authKey=pdU6HDpyzGUoc1QvQvCmzCbwzsoHgBbToF%2F0ChP4lNjPIPgWHGRE4I99XYGiTcNI&noverify=0&group_code=549833913" target="_blank">549833913</a>
|
|
18
|
+
### uvui官方群2:<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=2QbEeKBn6ysCyQ09V4mgst1W8onxFybQ&authKey=aMTGL5zCYwsinG%2FeH0qMlAqXAdyKr5AjXVf2oMnsmj7NCg%2F2HraMU%2FNFxELLIPvp&noverify=0&group_code=206060892" target="_blank">206060892</a>
|
|
19
|
+
|
|
20
|
+
## uvui特点
|
|
21
|
+
|
|
22
|
+
1. **uv-ui的前世今生**,`uv-ui` 是基于 `uview2.x` 版本改造而来。重命名也是为了避开发布冲突和很多组件 `u-`在 `nvue` 中不能使用的情况,所以这才诞生了`uv-ui`。感谢 `uview-ui` 作者的开源奉献,再次为开源点赞。 同时 `uv-ui` 也是无条件开源。
|
|
23
|
+
|
|
24
|
+
2. **全端兼容**,`uv-ui` 支持 uni-app Vue 3、app-vue、app-nvue、h5、小程序等。`uv-ui` 的组件都是多端自适应的,底层会抹平很多小程序平台的差异或 bug。
|
|
25
|
+
|
|
26
|
+
3. **扩展配置**,`uv-ui`内置的方法默认不再挂载到`uni`对象之上,也就意味着默认情况下不能在项目中直接使用`uni.$uv.xxx`使用内置方法。但是可以通过扩展可以解决,通过如下方式进行配置即可,使用方式请参考[扩展配置](https://www.uvui.cn/components/setting.html)。其中包括[ JS工具库](https://www.uvui.cn/components/setting.html#%E6%89%A9%E5%B1%95%E9%85%8D%E7%BD%AE-js%E5%B7%A5%E5%85%B7%E5%BA%93)、[ 自定义主题](https://www.uvui.cn/components/setting.html#%E6%89%A9%E5%B1%95%E9%85%8D%E7%BD%AE-%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98)、[ 基础样式](https://www.uvui.cn/components/setting.html#%E6%89%A9%E5%B1%95%E9%85%8D%E7%BD%AE-%E5%9F%BA%E7%A1%80%E6%A0%B7%E5%BC%8F)、[ setconfig](https://www.uvui.cn/components/setting.html#%E6%89%A9%E5%B1%95%E9%85%8D%E7%BD%AE-setconfig)等。
|
|
27
|
+
|
|
28
|
+
## 预览
|
|
29
|
+
|
|
30
|
+
通过微信或浏览器扫码查看演示效果。
|
|
31
|
+
|
|
32
|
+
<img src="https://www.uvui.cn/common/h5_qrcode.png" width="180" height="180" />
|
|
33
|
+
|
|
34
|
+
## 链接
|
|
35
|
+
|
|
36
|
+
- [官方文档](https://www.uvui.cn)
|
|
37
|
+
- [演示地址](https://h5.uvui.cn)
|
|
38
|
+
- [更新日志](https://www.uvui.cn/components/changelog.html)
|
|
39
|
+
- [关于我们](https://www.uvui.cn/cooperation/about.html)
|
|
40
|
+
- <a href="#list">组件列表</a>
|
|
41
|
+
|
|
42
|
+
## 交流反馈
|
|
43
|
+
|
|
44
|
+
欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uvui.cn/components/addQQGroup.html)
|
|
45
|
+
|
|
46
|
+
## 快速开始
|
|
47
|
+
|
|
48
|
+
方式一:`uv-ui` 强烈建议通过 `下载插件并导入HbuilderX` 导入组件。
|
|
49
|
+
|
|
50
|
+
方式二:下载完整 [uv-ui项目](https://ext.dcloud.net.cn/plugin?id=12287) 将 `uni_modules` 复制到自己的项目。
|
|
51
|
+
|
|
52
|
+
方式三:通过 `npm i @gmcb/uv-ui` 下载,此方法需要配置 easycom,配置详情可查看[安装](/components/install.html)。
|
|
53
|
+
|
|
54
|
+
请通过[快速上手](https://www.uvui.cn/components/quickstart.html)了解更详细的内容。
|
|
55
|
+
|
|
56
|
+
**注意:导入插件后,建议`HBuilderX`重新运行项目,可能新导入的插件不能实时更新而导致不能运行。**
|
|
57
|
+
|
|
58
|
+
## 使用方法
|
|
59
|
+
|
|
60
|
+
组件导入 `uni_modules` 后,直接在项目中使用,无需通过import引入组件。
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<template>
|
|
64
|
+
<uv-icon name="baidu" size="30" color="#909399"></uv-icon>
|
|
65
|
+
</template>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 扩展功能
|
|
69
|
+
|
|
70
|
+
`uv-ui` 内置了强大的工具函数、请求封装等,可以根据自身需求进行扩展配置,详情请查看[扩展配置](https://www.uvui.cn/components/setting.html)。
|
|
71
|
+
|
|
72
|
+
**注意:只有[扩展配置](https://www.uvui.cn/components/setting.html)后才能在自己的项目页面中使用组件库内置方法和变量等**。
|
|
73
|
+
|
|
74
|
+
<div id="list"></div>
|
|
75
|
+
|
|
76
|
+
## 组件列表
|
|
77
|
+
|
|
78
|
+
下表为 `uv-ui` 的扩展组件清单,点击每个组件**点击下载&安装**即可在详情页面导入组件到项目下,导入后建议重新运行即可直接使用,组件无需import和注册。
|
|
79
|
+
|
|
80
|
+
| 组件名 | 组件说明 |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| uv-calendars | [新版日历(推荐)](https://www.uvui.cn/components/calendars.html) |
|
|
83
|
+
| uv-drop-down | [下拉筛选](https://www.uvui.cn/components/dropDown.html) |
|
|
84
|
+
| uv-scroll-list | [横向滚动列表](https://www.uvui.cn/components/scrollList.html) |
|
|
85
|
+
| uv-vtabs | [垂直选项卡](https://www.uvui.cn/components/vtabs.html) |
|
|
86
|
+
| uv-pick-color | [颜色选择器](https://www.uvui.cn/components/pickColor.html) |
|
|
87
|
+
| uv-qrcode | [二维码](https://www.uvui.cn/components/qrcode.html) |
|
|
88
|
+
| uv-waterfall | [瀑布流](https://www.uvui.cn/components/waterfall.html) |
|
|
89
|
+
| uv-row | [Layout 布局](https://www.uvui.cn/components/layout.html) |
|
|
90
|
+
| uv-icon | [图标](https://www.uvui.cn/components/icon.html) |
|
|
91
|
+
| uv-button | [按钮](https://www.uvui.cn/components/button.html) |
|
|
92
|
+
| uv-text | [文本](https://www.uvui.cn/components/text.html) |
|
|
93
|
+
| uv-link | [超链接](https://www.uvui.cn/components/link.html) |
|
|
94
|
+
| uv-image | [图片](https://www.uvui.cn/components/image.html) |
|
|
95
|
+
| uv-transition | [动画](https://www.uvui.cn/components/transition.html) |
|
|
96
|
+
| uv-form | [表单](https://www.uvui.cn/components/form.html) |
|
|
97
|
+
| uv-input | [增强输入框](https://www.uvui.cn/components/input.html) |
|
|
98
|
+
| uv-textarea | [增强文本域](https://www.uvui.cn/components/textarea.html) |
|
|
99
|
+
| uv-checkbox | [复选框](https://www.uvui.cn/components/checkbox.html) |
|
|
100
|
+
| uv-radio | [单选框](https://www.uvui.cn/components/radio.html) |
|
|
101
|
+
| uv-switch | [开关选择器](https://www.uvui.cn/components/switch.html) |
|
|
102
|
+
| uv-calendar | [日历](https://www.uvui.cn/components/calendar.html) |
|
|
103
|
+
| uv-picker | [选择器](https://www.uvui.cn/components/picker.html) |
|
|
104
|
+
| uv-datetime-picker | [时间选择器](https://www.uvui.cn/components/datetimePicker.html) |
|
|
105
|
+
| uv-code | [验证码倒计时](https://www.uvui.cn/components/code.html) |
|
|
106
|
+
| uv-keyboard | [键盘](https://www.uvui.cn/components/keyboard.html) |
|
|
107
|
+
| uv-rate | [评分](https://www.uvui.cn/components/rate.html) |
|
|
108
|
+
| uv-search | [多功能搜索框](https://www.uvui.cn/components/search.html) |
|
|
109
|
+
| uv-number-box | [步进器](https://www.uvui.cn/components/numberBox.html) |
|
|
110
|
+
| uv-upload | [上传](https://www.uvui.cn/components/upload.html) |
|
|
111
|
+
| uv-slider | [滑动选择器](https://www.uvui.cn/components/slider.html) |
|
|
112
|
+
| uv-list | [列表](https://www.uvui.cn/components/list.html) |
|
|
113
|
+
| uv-index-list | [索引列表](https://www.uvui.cn/components/indexList.html) |
|
|
114
|
+
| uv-tags | [标签](https://www.uvui.cn/components/tag.html) |
|
|
115
|
+
| uv-line-progress | [线形进度条](https://www.uvui.cn/components/lineProgress.html) |
|
|
116
|
+
| uv-badge | [徽标数](https://www.uvui.cn/components/badge.html) |
|
|
117
|
+
| uv-count-down | [倒计时](https://www.uvui.cn/components/countDown.html) |
|
|
118
|
+
| uv-count-to | [数字滚动](https://www.uvui.cn/components/countTo.html) |
|
|
119
|
+
| uv-avatar | [头像](https://www.uvui.cn/components/avatar.html) |
|
|
120
|
+
| uv-skeleton | [骨架屏](https://www.uvui.cn/components/skeleton.html) |
|
|
121
|
+
| uv-loading-icon | [加载动画](https://www.uvui.cn/components/loadingIcon.html) |
|
|
122
|
+
| uv-loading-page | [加载页](https://www.uvui.cn/components/loadingPage.html) |
|
|
123
|
+
| uv-load-more | [加载更多](https://www.uvui.cn/components/loadMore.html) |
|
|
124
|
+
| uv-empty | [内容为空](https://www.uvui.cn/components/empty.html) |
|
|
125
|
+
| uv-tooltip | [长按提示](https://www.uvui.cn/components/tooltip.html) |
|
|
126
|
+
| uv-alert | [警告提示](https://www.uvui.cn/components/alert.html) |
|
|
127
|
+
| uv-toast | [消息提示](https://www.uvui.cn/components/toast.html) |
|
|
128
|
+
| uv-notice-bar | [滚动通知](https://www.uvui.cn/components/noticeBar.html) |
|
|
129
|
+
| uv-notify | [消息提示](https://www.uvui.cn/components/notify.html) |
|
|
130
|
+
| uv-no-network | [无网络提示](https://www.uvui.cn/components/noNetwork.html) |
|
|
131
|
+
| uv-popup | [弹出层](https://www.uvui.cn/components/popup.html) |
|
|
132
|
+
| uv-modal | [模态框](https://www.uvui.cn/components/modal.html) |
|
|
133
|
+
| uv-cell | [单元格](https://www.uvui.cn/components/cell.html) |
|
|
134
|
+
| uv-swipe-action | [滑动单元格](https://www.uvui.cn/components/swipeAction.html) |
|
|
135
|
+
| uv-swiper | [轮播图](https://www.uvui.cn/components/swiper.html) |
|
|
136
|
+
| uv-collapse | [折叠面板](https://www.uvui.cn/components/collapse.html) |
|
|
137
|
+
| uv-grid | [宫格布局](https://www.uvui.cn/components/grid.html) |
|
|
138
|
+
| uv-album | [相册](https://www.uvui.cn/components/album.html) |
|
|
139
|
+
| uv-tabbar | [底部导航栏](https://www.uvui.cn/components/tabbar.html) |
|
|
140
|
+
| uv-back-top | [返回顶部](https://www.uvui.cn/components/backTop.html) |
|
|
141
|
+
| uv-navbar | [自定义导航栏](https://www.uvui.cn/components/navbar.html) |
|
|
142
|
+
| uv-action-sheet | [底部操作菜单](https://www.uvui.cn/components/actionSheet.html) |
|
|
143
|
+
| uv-tabs | [标签选项卡](https://www.uvui.cn/components/tabs.html) |
|
|
144
|
+
| uv-steps | [步骤条](https://www.uvui.cn/components/steps.html) |
|
|
145
|
+
| uv-subsection | [分段器](https://www.uvui.cn/components/subsection.html) |
|
|
146
|
+
| uv-sticky | [吸顶](https://www.uvui.cn/components/sticky.html) |
|
|
147
|
+
| uv-parse | [富文本解析器](https://www.uvui.cn/components/parse.html) |
|
|
148
|
+
| uv-overlay | [遮罩层](https://www.uvui.cn/components/overlay.html) |
|
|
149
|
+
| uv-code-input | [验证码输入](https://www.uvui.cn/components/codeInput.html) |
|
|
150
|
+
| uv-read-more | [展开阅读更多](https://www.uvui.cn/components/readMore.html) |
|
|
151
|
+
| uv-line | [线条](https://www.uvui.cn/components/line.html) |
|
|
152
|
+
| uv-gap | [间隔槽](https://www.uvui.cn/components/gap.html) |
|
|
153
|
+
| uv-divider | [分割线](https://www.uvui.cn/components/divider.html) |
|
|
154
|
+
|
|
155
|
+
## 版权信息
|
|
156
|
+
uv-ui遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uv-ui应用到您的产品中。
|
|
157
|
+
|
|
158
|
+
## 作者想说
|
|
159
|
+
- 开源真的不易,不图大家的钱财,所以希望大家多多鼓励支持,希望不要恶意评论,有问题加群快速解决。
|
|
160
|
+
- 遇到BUG,是一件很正常的事情,是程序肯定就有BUG,所以希望大家能以理解的心态去提出BUG,然后作者才有动力去努力修复。
|
|
161
|
+
- 最后觉得好用的小伙伴,不要吝啬你的双手,给个好评就是给我们最大的鼓励。
|
|
162
|
+
|
|
163
|
+
# 恶评者手下留情,有事加QQ群解决:549833913
|