@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,133 @@
|
|
|
1
|
+
## IndexList 索引列表 <to-api/>
|
|
2
|
+
|
|
3
|
+
<demo-model url="/pages/componentsD/indexList/indexList"></demo-model>
|
|
4
|
+
|
|
5
|
+
::: tip ✈
|
|
6
|
+
|
|
7
|
+
**组件名:uv-index-list > uv-index-item**
|
|
8
|
+
|
|
9
|
+
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-index-list)
|
|
10
|
+
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
用于展示索引列表,右侧带索引的列表,方便快速定位到具体内容,通常用于城市/机场选择等场景。
|
|
14
|
+
|
|
15
|
+
### 平台兼容性
|
|
16
|
+
|
|
17
|
+
|App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
|
|
18
|
+
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|
19
|
+
|√|√|√|√|√|√|
|
|
20
|
+
|
|
21
|
+
### 基本使用
|
|
22
|
+
|
|
23
|
+
外层包裹一个`index-list`组件,锚点通过`index-anchor`组件传入,自定义列表内容通过`index-item`嵌套使用
|
|
24
|
+
- nvue需要将`index-anchor`写在`index-item`的外部
|
|
25
|
+
- 非nvue需要将`index-anchor`嵌套在`index-item`的内部
|
|
26
|
+
- 可以通过`index-list`参数自定义索引字符列表
|
|
27
|
+
|
|
28
|
+
案例如下:
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<template>
|
|
32
|
+
<view>
|
|
33
|
+
<view style="height: 100rpx;width: 750rpx;background-color: pink;">自定义头部</view>
|
|
34
|
+
<uv-index-list :index-list="indexList" customNavHeight="100rpx">
|
|
35
|
+
<template v-slot:header>
|
|
36
|
+
<view style="height: 100rpx;width: 750rpx;background-color: #3c9cff;">头部内容</view>
|
|
37
|
+
</template>
|
|
38
|
+
<template v-for="(item, index) in itemArr">
|
|
39
|
+
<!-- #ifdef APP-NVUE -->
|
|
40
|
+
<uv-index-anchor :text="indexList[index]"></uv-index-anchor>
|
|
41
|
+
<!-- #endif -->
|
|
42
|
+
<uv-index-item>
|
|
43
|
+
<!-- #ifndef APP-NVUE -->
|
|
44
|
+
<uv-index-anchor :text="indexList[index]"></uv-index-anchor>
|
|
45
|
+
<!-- #endif -->
|
|
46
|
+
<view class="list-cell" v-for="(cell, index) in item">
|
|
47
|
+
{{cell}}
|
|
48
|
+
</view>
|
|
49
|
+
</uv-index-item>
|
|
50
|
+
</template>
|
|
51
|
+
</uv-index-list>
|
|
52
|
+
</view>
|
|
53
|
+
</template>
|
|
54
|
+
<script setup>
|
|
55
|
+
import { ref } from 'vue';
|
|
56
|
+
|
|
57
|
+
const indexList = ref(["A", "B", "C", "D", "E", "F", "G"]);
|
|
58
|
+
const itemArr = ref([['列表A1', '列表A2', '列表A3'], ['列表B1', '列表B2', '列表B3'], ['列表C1', '列表C2', '列表C3'], ['列表D1', '列表D2', '列表D3'], ['列表E1', '列表E2', '列表E3'], ['列表F1', '列表F2', '列表F3'], ['列表G1', '列表G2', '列表G3']]);
|
|
59
|
+
|
|
60
|
+
</script>
|
|
61
|
+
<style lang="scss" scoped>
|
|
62
|
+
.list-cell {
|
|
63
|
+
/* #ifndef APP-PLUS */
|
|
64
|
+
display: flex;
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
width: 100%;
|
|
67
|
+
/* #endif */
|
|
68
|
+
padding: 10px 24rpx;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
color: #323233;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
line-height: 24px;
|
|
73
|
+
background-color: #fff;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 自定义导航栏
|
|
79
|
+
|
|
80
|
+
默认情况下,组件的锚点是吸附在导航栏下方的,如果您修改了导航栏,比如取消导航栏、或者自定义了导航栏,就需要指定吸顶的高度,也就是`custom-nav-height`
|
|
81
|
+
的值,注意这个值的单位为`px`:
|
|
82
|
+
|
|
83
|
+
- 如果自定义了导航栏,需要`custom-nav-height`设置为导航栏的高度,上面示例代码也有模拟
|
|
84
|
+
|
|
85
|
+
### 完整示例
|
|
86
|
+
|
|
87
|
+
::: tip 完整示例下载地址
|
|
88
|
+
|
|
89
|
+
[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
|
90
|
+
|
|
91
|
+
:::
|
|
92
|
+
|
|
93
|
+
### API
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### IndexList Props
|
|
97
|
+
|
|
98
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
99
|
+
|:- |:- |:- |:- |:- |
|
|
100
|
+
| inactiveColor | 右边锚点状态非激活时的颜色 | String | #606266 | - |
|
|
101
|
+
| activeColor | 右边锚点状态激活时的颜色 | String | #5677fc | - |
|
|
102
|
+
| indexList | 索引字符列表,数组 | Array[string | number] | A-Z | - |
|
|
103
|
+
| sticky | 是否开启锚点自动吸顶 | Boolean | true | false |
|
|
104
|
+
| customNavHeight | 自定义导航栏的高度,单位默认px | String | Number | 0 | - |
|
|
105
|
+
|
|
106
|
+
### IndexAnchor Props
|
|
107
|
+
|
|
108
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
109
|
+
|:- |:- |:- |:- |:- |
|
|
110
|
+
| text | 列表锚点文本内容 | String | Number | - | - |
|
|
111
|
+
| color | 列表锚点文字颜色 | String | #606266 | - |
|
|
112
|
+
| size | 列表锚点文字大小,单位默认px | String | Number | 14 | - |
|
|
113
|
+
| bgColor | 列表锚点背景颜色 | String | #dedede | - |
|
|
114
|
+
| height | 列表锚点高度,单位默认px | String | Number | 32 | - |
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### IndexList Events
|
|
118
|
+
|
|
119
|
+
|事件名 |说明 |回调参数 |
|
|
120
|
+
|:- |:- |:- |
|
|
121
|
+
| @select| 选中右边索引字符时触发 | index: 索引字符 |
|
|
122
|
+
|
|
123
|
+
### IndexItem Slots
|
|
124
|
+
|
|
125
|
+
| 名称 | 说明 |
|
|
126
|
+
|:- |:- |
|
|
127
|
+
| default | 自定义列表内容 |
|
|
128
|
+
|
|
129
|
+
<style scoped>
|
|
130
|
+
h3[id=indexitem-slots] + table thead tr th:nth-child(2) {
|
|
131
|
+
width: 70%;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
## Input 输入框 <to-api/>
|
|
2
|
+
|
|
3
|
+
<demo-model url="/pages/componentsB/input/input"></demo-model>
|
|
4
|
+
|
|
5
|
+
::: tip ✈
|
|
6
|
+
|
|
7
|
+
**组件名:uv-input**
|
|
8
|
+
|
|
9
|
+
[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uv-input)
|
|
10
|
+
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件[uv-form](/components/form.html)而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
|
|
15
|
+
|
|
16
|
+
应该在`uv-form`中嵌套`uv-form-item`,再嵌套`uv-input`去实现。
|
|
17
|
+
|
|
18
|
+
### 平台兼容性
|
|
19
|
+
|
|
20
|
+
|App(vue)|App(nvue)|H5|小程序|VUE2|VUE3|
|
|
21
|
+
|:-:|:-:|:-:|:-:|:-:|:-:|
|
|
22
|
+
|√|√|√|√|√|√|
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### 基本使用
|
|
26
|
+
|
|
27
|
+
- 通过`type`设置输入框的类型,默认text
|
|
28
|
+
- 通过`placeholder`设置输入框为空时的占位符
|
|
29
|
+
- 通过`border`配置是否显示输入框的边框
|
|
30
|
+
- 绑定`@change`事件
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<template>
|
|
34
|
+
<uv-input placeholder="请输入内容" border="surround" v-model="value" @change="change"></uv-input>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script setup>
|
|
38
|
+
import { ref } from "vue";
|
|
39
|
+
const value = ref('');
|
|
40
|
+
function change(e) {
|
|
41
|
+
console.log('change', e);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
### 可清空字符
|
|
47
|
+
|
|
48
|
+
将`clearable`设置为`true`,会在输入框后方增加一个清空按钮。
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<template>
|
|
52
|
+
<uv-input placeholder="请输入内容" border="surround" clearable ></uv-input>
|
|
53
|
+
</template>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 下划线
|
|
57
|
+
|
|
58
|
+
通过设置属性`border`为`bottom`即可变成一个下划线
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<template>
|
|
62
|
+
<uv-input placeholder="请输入内容" border="bottom" ></uv-input>
|
|
63
|
+
</template>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 前后图标
|
|
67
|
+
|
|
68
|
+
- 前后置图标可自由设置样式信息。
|
|
69
|
+
|
|
70
|
+
```vue
|
|
71
|
+
<template>
|
|
72
|
+
<view>
|
|
73
|
+
<uv-input
|
|
74
|
+
placeholder="前置图标"
|
|
75
|
+
prefixIcon="search"
|
|
76
|
+
prefixIconStyle="font-size: 22px;color: #909399"
|
|
77
|
+
></uv-input>
|
|
78
|
+
<uv-input
|
|
79
|
+
placeholder="后置图标"
|
|
80
|
+
suffixIcon="map-fill"
|
|
81
|
+
suffixIconStyle="color: #909399"
|
|
82
|
+
></uv-input>
|
|
83
|
+
</view>
|
|
84
|
+
</template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 前后插槽
|
|
88
|
+
|
|
89
|
+
通过设置`slot`为`prefix`或`suffix`来指定前后插槽
|
|
90
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<template>
|
|
93
|
+
<view>
|
|
94
|
+
<uv-input placeholder="前置插槽">
|
|
95
|
+
<!-- vue3模式下必须使用v-slot:prefix -->
|
|
96
|
+
<template v-slot:prefix>
|
|
97
|
+
<uv-text
|
|
98
|
+
text="http://"
|
|
99
|
+
margin="0 3px 0 0"
|
|
100
|
+
type="tips"
|
|
101
|
+
></uv-text>
|
|
102
|
+
</template>
|
|
103
|
+
</uv-input>
|
|
104
|
+
<uv-input placeholder="后置插槽">
|
|
105
|
+
<!-- vue3模式下必须使用v-slot:suffix -->
|
|
106
|
+
<template v-slot:suffix>
|
|
107
|
+
<uv-code
|
|
108
|
+
ref="uCode"
|
|
109
|
+
@change="codeChange"
|
|
110
|
+
seconds="20"
|
|
111
|
+
changeText="X秒重新获取哈哈哈"
|
|
112
|
+
></uv-code>
|
|
113
|
+
<uv-button
|
|
114
|
+
@click="getCode"
|
|
115
|
+
:text="tips"
|
|
116
|
+
type="success"
|
|
117
|
+
size="mini"
|
|
118
|
+
></uv-button>
|
|
119
|
+
</template>
|
|
120
|
+
</uv-input>
|
|
121
|
+
</view>
|
|
122
|
+
</template>
|
|
123
|
+
<script setup>
|
|
124
|
+
import { toast } from '@gmcb/uv-ui/libs/function/index.js';
|
|
125
|
+
import { ref } from "vue";
|
|
126
|
+
const tips = ref('');
|
|
127
|
+
const value = ref('内容');
|
|
128
|
+
const uCode = ref(null);
|
|
129
|
+
function codeChange(text) {
|
|
130
|
+
tips.value = text;
|
|
131
|
+
}
|
|
132
|
+
function getCode() {
|
|
133
|
+
if (uCode.value?.canGetCode) {
|
|
134
|
+
// 模拟向后端请求验证码
|
|
135
|
+
uni.showLoading({
|
|
136
|
+
title: '正在获取验证码'
|
|
137
|
+
});
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
uni.hideLoading();
|
|
140
|
+
// 这里此提示会被 start() 方法中的提示覆盖
|
|
141
|
+
toast('验证码已发送');
|
|
142
|
+
// 通知验证码组件内部开始倒计时
|
|
143
|
+
uCode.value?.start();
|
|
144
|
+
}, 2000);
|
|
145
|
+
} else {
|
|
146
|
+
toast('倒计时结束后再发送');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function change(e) {
|
|
150
|
+
console.log('change', e);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
</script>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### 完整示例
|
|
157
|
+
|
|
158
|
+
::: tip 完整示例下载地址
|
|
159
|
+
|
|
160
|
+
[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
|
161
|
+
|
|
162
|
+
:::
|
|
163
|
+
|
|
164
|
+
### API
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### Input Props
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
|
171
|
+
|:- |:- |:- |:- |:- |
|
|
172
|
+
| value / v-model | 输入的值 | Number | String | - | - |
|
|
173
|
+
| type | 输入框类型,见[Type Options](/components/input.html#type-options) | String | text | text | number | idcard | digit | password |
|
|
174
|
+
| disabled | 是否禁用输入框 | Boolean | false | true | false |
|
|
175
|
+
| disabledColor | 禁用状态时的背景色 | String | #f5f7fa | - |
|
|
176
|
+
| clearable | 是否显示清除控件 | Boolean | false | true | false |
|
|
177
|
+
| password | 是否密码类型 | Boolean | false | true | false |
|
|
178
|
+
| maxlength | 最大输入长度,设置为 -1 的时候不限制最大长度。(注意:maxlength都是小写) | String | Number | -1 | - |
|
|
179
|
+
| placeholder | 输入框为空时的占位符 | String | - | - |
|
|
180
|
+
| placeholderClass | 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ | String | input-placeholder | - |
|
|
181
|
+
| placeholderStyle | 指定placeholder的样式,字符串/对象形式,如"color: red;" | String | Object | color: #c0c4cc | - |
|
|
182
|
+
| confirmType | 设置右下角按钮的文字,兼容性详见uni-app文档 | String | done |done | send | search | next | go | done |
|
|
183
|
+
| confirmHold | 点击键盘右下角按钮时是否保持键盘不收起,H5无效 | Boolean | false | true | false |
|
|
184
|
+
| holdKeyboard | focus时,点击页面的时候不收起键盘,微信小程序有效 | Boolean | false | true | false |
|
|
185
|
+
| focus | 自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 | Boolean | false | true | false |
|
|
186
|
+
| autoBlur | 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 | Boolean | false | true | false |
|
|
187
|
+
| ignoreCompositionEvent | 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件 | Boolean | true | true | false |
|
|
188
|
+
| cursor | 指定focus时光标的位置 | String | Number | -1 | - |
|
|
189
|
+
| cursorSpacing | 输入框聚焦时底部与键盘的距离 | String | Number | 30 | - |
|
|
190
|
+
| selectionStart | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 | String | Number | -1 | - |
|
|
191
|
+
| selectionEnd | 光标结束位置,自动聚集时有效,需与selection-start搭配使用 | String | Number | -1 | - |
|
|
192
|
+
| adjustPosition | 键盘弹起时,是否自动上推页面 | Boolean | true | true | false |
|
|
193
|
+
| inputAlign | 输入框内容对齐方式 | String | left | left | center | right |
|
|
194
|
+
| fontSize | 输入框字体的大小 | String | Number | 15px | - |
|
|
195
|
+
| color | 输入框字体颜色 | String | #303133 | - |
|
|
196
|
+
| prefixIcon | 输入框前置图标 | String | - | - |
|
|
197
|
+
| prefixIconStyle | 前置图标样式,对象或字符串 | String | Object | - | - |
|
|
198
|
+
| suffixIcon | 输入框后置图标 | String | - | - |
|
|
199
|
+
| suffixIconStyle | 后置图标样式,对象或字符串 | String | Object | - | - |
|
|
200
|
+
| border | 边框类型,surround-四周边框,bottom-底部边框,none-无边框 | String | surround | surround | bottom | none |
|
|
201
|
+
| readonly | 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 | Boolean | false | true | false |
|
|
202
|
+
| shape | 输入框形状,circle-圆形,square-方形 | String | square | square | circle |
|
|
203
|
+
| formatter | 输入过滤或格式化函数(如需兼容微信小程序,则只能通过`setFormatter`方法) | Function | null | - |
|
|
204
|
+
| customStyle | 自定义外部样式 | Object | - | - | -
|
|
205
|
+
|
|
206
|
+
### Type Options
|
|
207
|
+
|
|
208
|
+
|属性名 |说明 |
|
|
209
|
+
|:- |:- |
|
|
210
|
+
| text | 文本输入键盘 |
|
|
211
|
+
| number | 数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数 |
|
|
212
|
+
| idcard | 身份证输入键盘,微信、支付宝、百度、QQ小程序 |
|
|
213
|
+
| digit | 带小数点的数字键盘,App的nvue页面、微信、支付宝、百度、头条、QQ小程序 |
|
|
214
|
+
| password | 等同于设置`password`为`true`的效果 |
|
|
215
|
+
|
|
216
|
+
### Input Methods
|
|
217
|
+
| 方法名 | 说明 |
|
|
218
|
+
| :-| :- |
|
|
219
|
+
| setFormatter | 为兼容微信小程序而暴露的内部方法,见上方说明 |
|
|
220
|
+
|
|
221
|
+
### Input Events
|
|
222
|
+
|
|
223
|
+
|事件名 |说明 |回调参数 |版本 |
|
|
224
|
+
| :- | :- | :- | :- |
|
|
225
|
+
| @blur| 输入框失去焦点时触发 | value:内容值 | - |
|
|
226
|
+
| @focus| 输入框聚焦时触发 |- | - |
|
|
227
|
+
| @confirm| 点击完成按钮时触发 | value:内容值 | - |
|
|
228
|
+
| @keyboardheightchange| 键盘高度发生变化的时候触发此事件 | - | 微信小程序2.7.0+、App 3.1.0+ |
|
|
229
|
+
| @input| 内容发生变化触发此事件 | value:内容值 | - |
|
|
230
|
+
| @clear| 点击清空内容 | - | - |
|
|
231
|
+
|
|
232
|
+
### Input Slots
|
|
233
|
+
|
|
234
|
+
| 名称 | 说明 |
|
|
235
|
+
| :- | :- |
|
|
236
|
+
| prefix | 输入框前置内容 |
|
|
237
|
+
| suffix | 输入框后置内容 |
|
|
238
|
+
|
|
239
|
+
<style scoped>
|
|
240
|
+
h3[id=input-slots] + table thead tr th:nth-child(2),
|
|
241
|
+
h3[id=input-methods] + table thead tr th:nth-child(2){
|
|
242
|
+
width: 70%;
|
|
243
|
+
}
|
|
244
|
+
h3[id=type-options] + table {
|
|
245
|
+
width: auto;
|
|
246
|
+
}
|
|
247
|
+
h3[id=type-options] + table thead tr th:nth-child(2){
|
|
248
|
+
width: 76%;
|
|
249
|
+
}
|
|
250
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
## 安装
|
|
2
|
+
|
|
3
|
+
<demo-model url="/"></demo-model>
|
|
4
|
+
|
|
5
|
+
::: warning 提示
|
|
6
|
+
1. uv-ui 现在只推荐使用 `easycom` ,如自己引用组件,可能会出现组件找不到的问题。
|
|
7
|
+
2. 除了npm下载需要 `easycom` 配置 和 `vue.config.js` 配置,其他可以不进行任何配置即可直接在页面中使用组件,建议重新运行下项目。
|
|
8
|
+
3. 强烈建议了解[扩展配置](/components/setting.html)功能,如果需要使用组件库内部的API等工具,需要进行扩展配置。
|
|
9
|
+
4. **如果你在安装组件之前就运行了项目,那么安装配置好后,需要重新启动项目,以微信小程序为例:关闭微信编辑器,最好是删除一次unpackage文件,然后重新运行项目,一般就可正常运行。如果不这样做,很有可能存在缓存,你怎么刷新都没用。**
|
|
10
|
+
:::
|
|
11
|
+
|
|
12
|
+
### **HbuilderX 方式(推荐)**
|
|
13
|
+
|
|
14
|
+
#### **插件市场下载入口:[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)**
|
|
15
|
+
|
|
16
|
+
如果您是使用 `Hbuilder X` 开发的用户,您可以在 `uni-app` 插件市场通过 `uni_modules` 的形式进行安装,此安装方式可以方便您后续在 `uni_modules` 对 `uv-ui` 进行一键升级,右键uni_modules目录或右键某组件,均可进行一键升级。
|
|
17
|
+
|
|
18
|
+
- 在uni-app插件市场右上角选择`下载插件并导入HBuilderX`,导入到对应的项目中即可。
|
|
19
|
+
|
|
20
|
+
### **NPM 方式**
|
|
21
|
+
|
|
22
|
+
- 在项目根目录执行如下命令安装uv-ui(建议使用npm或yarn安装,其他方式可能安装后使用不了):
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm i @gmcb/uv-ui
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- 在项目根目录pages.json中配置easycom:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
// pages.json
|
|
32
|
+
{
|
|
33
|
+
"easycom": {
|
|
34
|
+
"autoscan": true,
|
|
35
|
+
"custom": {
|
|
36
|
+
"^uv-(.*)": "@gmcb/uv-ui/components/uv-$1/uv-$1.vue"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
// 其他内容
|
|
40
|
+
pages:[
|
|
41
|
+
// ...
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**注意:**
|
|
47
|
+
- 如果 Vue CLI 构建环境默认忽略 `node_modules` 中的文件,导致条件编译失效,可以通过配置 `vue.config.js` 解决:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// 在根目录创建 vue.config.js 文件,并配置如下
|
|
51
|
+
module.exports = {
|
|
52
|
+
transpileDependencies: ['@gmcb/uv-ui']
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### **其他方式**
|
|
57
|
+
|
|
58
|
+
- 在[插件市场 uv-ui](https://ext.dcloud.net.cn/plugin?id=12287)或[uv-ui的git仓库](https://gitee.com/climblee/uv-ui),直接下载uv-ui的项目包。
|
|
59
|
+
- 将uv-ui项目的uni_modules复制到自己的项目中即可,和方式一导入的方式类似。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## 介绍
|
|
2
|
+
|
|
3
|
+
`@gmcb/uv-ui` 是基于 uv-ui 的 uni-app 多端 UI 组件包。
|
|
4
|
+
|
|
5
|
+
#### 来由
|
|
6
|
+
|
|
7
|
+
uv-ui破釜沉舟之兼容vue3+2、nvue、app、h5、多端小程序的`uni-app`生态框架,大部分组件基于uView2.x,在经过改进后全面支持`vue3`,部分组件做了进一步的优化,支持单独导入,方便开发者选择导入需要的组件。
|
|
8
|
+
|
|
9
|
+
uv-ui来源于社区,也回归到社区,正是有一群热爱`uni-app`生态的同学推着它前行,而我们也一如既往的承诺,uv-ui永久开源,永远免费。我们会在部分组件下载时配置广告抵消一部分成本,希望大家理解。
|
|
10
|
+
|
|
11
|
+
关于uv-ui的取名来由,首字母`u`来自于`uni-app`首字母,`uni-app`是基于`Vue.js`,`Vue`和`View`(延伸为UI、视图之意)同音,故取名uv-ui,表达源于uni-app、vue、uView之意,同时在此也对它们表示感谢。
|
|
12
|
+
|
|
13
|
+
#### 适用领域
|
|
14
|
+
|
|
15
|
+
uv-ui是`uni-app`生态专用的UI框架,`uni-app` 是一个使用 `Vue.js` 开发所有前端应用的框架,开发者编写一套代码,
|
|
16
|
+
可发布到iOS、Android、H5、以及各种小程序(微信/支付宝/百度/头条/QQ/钉钉)等多个平台(引言自uni-app网)。目前微信小程序、百度小程序、抖音小程序、支付宝小程序都经过多次测试修改,后续会持续优化。
|
|
17
|
+
|
|
18
|
+
#### 关于PR
|
|
19
|
+
|
|
20
|
+
> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uv-ui是一个需要兼容多个平台的(多端小程序、h5、app-nvue、 app-vue)UI框架。
|
|
21
|
+
> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢!(为了方便管理,目前只接受Gitee Pull Request)
|
|
22
|
+
|
|
23
|
+
#### 版权信息
|
|
24
|
+
|
|
25
|
+
uv-ui遵循[MIT](https://baike.baidu.com/item/MIT/10772952)开源协议,意味着您无需支付任何费用,也无需授权,即可将uv-ui应用到您的产品中。
|
|
26
|
+
|
|
27
|
+
注意:这并不意味着您可以将uv-ui应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uv-ui相关方及言信科技不承担任何责任。
|
|
28
|
+
|
|
29
|
+
#### 插件市场
|
|
30
|
+
|
|
31
|
+
下载入口:[https://ext.dcloud.net.cn/plugin?name=uv-ui](https://ext.dcloud.net.cn/plugin?name=uv-ui)
|
|
32
|
+
|