Skip to content

Commit 9e15c6c

Browse files
committed
1. form表单验证新增toast的错误提示方式,配置erroryType=['toast']即可
2. search搜索框组件新增search-icon参数,可自定义左侧的图标 3. card组件新增可控制头部和尾部显示与否的show-head和show-foot参数 4. collapse组件新增控制头部的slot参数title和title-all 5. form-item组件左侧红色星标通过required参数配置,仅起展示作用,如需校验是否填写请配置rules规则 6. 改正section组件的show-line默认为false的问题 7. 修复popup组件在低性能安卓设备上可能存在弹出动画无效的问题 8. 修复line线条组件可能在小程序上无效的问题 9. 修复upload组件在H5上可能弹出两次选择文件窗口的问题 10. 修复verificationCode验证码倒计时设置保持倒计时模式时多次切换页面倒计时可能混乱的问题 11. 修复calendar日历组件的关闭按钮在支付宝小程序上位置不对的问题 12. 修复numberBox组件渲染完成时自动触发一次change事件的问题
1 parent 3765301 commit 9e15c6c

File tree

34 files changed

+576
-459
lines changed

34 files changed

+576
-459
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全
1919
- 按需引入,精简打包体积
2020

2121

22+
## 友情链接
23+
24+
<br>
25+
26+
#### **vue-admin-beautiful** —— [企业级、通用型中后台前端解决方案(基于vue/cli 4 最新版,同时支持电脑,手机,平板)](https://github.com/chuzhixin/vue-admin-beautiful)
27+
28+
#### **vue-admin-beautiful** —— [在线演示](http://beautiful.panm.cn/vue-admin-beautiful/#/index)
29+
<br>
30+
2231
## 安装
2332

2433
```bash

manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {
9+
// APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭
10+
"optimization" : {
11+
"subPackages" : true
12+
},
913
"safearea" : {
1014
"bottom" : {
1115
"offset" : "none"

pages.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"easycom": {
33
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
44
},
5-
"condition": { //模式配置,仅开发期间生效
6-
"current": 0, //当前激活的模式(list 的索引项)
7-
"list": [{
8-
"name": "test", //模式名称
9-
"path": "pages/template/citySelect/index", //启动页面,必选
10-
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11-
}]
12-
},
5+
// "condition": { //模式配置,仅开发期间生效
6+
// "current": 0, //当前激活的模式(list 的索引项)
7+
// "list": [{
8+
// "name": "test", //模式名称
9+
// "path": "pages/componentsB/swipeAction/index", //启动页面,必选
10+
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
// }]
12+
// },
1313
"pages": [
1414
// 演示-组件
1515
{

pages/componentsA/empty/index.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<view class="u-no-demo-here">
7-
滚动页面,在由下角即可看到返回顶部按钮
8-
</view>
96
<u-empty :mode="mode">
107
<u-button v-if="slot" slot="bottom" size="medium">
118
slot按钮

pages/componentsA/form/index.vue

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</view>
7777
<view class="u-config-item">
7878
<view class="u-item-title">错误提示方式</view>
79-
<u-subsection vibrateShort :list="['文字', '下划线', '输入框', '下划线+文字']" @change="errorChange"></u-subsection>
79+
<u-subsection vibrateShort :list="['message', 'toast', '下划线', '输入框']" @change="errorChange"></u-subsection>
8080
</view>
8181
</view>
8282
</view>
@@ -131,14 +131,32 @@ export default {
131131
trigger: ['change','blur'],
132132
},
133133
{
134+
// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
134135
validator: (rule, value, callback) => {
135136
// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
136137
return this.$u.test.chinese(value);
137138
},
138139
message: '姓名必须为中文',
139140
// 触发器可以同时用blur和change,二者之间用英文逗号隔开
140141
trigger: ['change','blur'],
141-
}
142+
},
143+
// 异步验证,用途:比如用户注册时输入完账号,后端检查账号是否已存在
144+
// {
145+
// trigger: ['blur'],
146+
// // 异步验证需要通过调用callback(),并且在里面抛出new Error()
147+
// // 抛出的内容为需要提示的信息,和其他方式的message属性的提示一样
148+
// asyncValidator: (rule, value, callback) => {
149+
// this.$u.post('/ebapi/public_api/index').then(res => {
150+
// // 如果验证出错,需要在callback()抛出new Error('错误提示信息')
151+
// if(res.error) {
152+
// callback(new Error('姓名重复'));
153+
// } else {
154+
// // 如果没有错误,也要执行callback()回调
155+
// callback();
156+
// }
157+
// })
158+
// },
159+
// }
142160
],
143161
sex: [
144162
{
@@ -410,12 +428,9 @@ export default {
410428
},
411429
errorChange(index) {
412430
if(index == 0) this.errorType = ['message'];
413-
if(index == 1) this.errorType = ['border-bottom'];
414-
if(index == 2) {
415-
this.errorType = ['border'];
416-
this.border = true;
417-
}
418-
if(index == 3) this.errorType = ['message', 'border-bottom'];
431+
if(index == 1) this.errorType = ['toast'];
432+
if(index == 2) this.errorType = ['border-bottom'];
433+
if(index == 3) this.errorType = ['border'];
419434
}
420435
}
421436
};

pages/componentsA/verificationCode/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
66
<u-toast ref="uToast"></u-toast>
7-
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode"
7+
<u-verification-code :keep-running="true" :seconds="seconds" @end="end" @start="start" ref="uCode"
88
@change="codeChange" :startText="startText" :changeText="changeText"
99
:endText="endText"></u-verification-code>
1010
<u-button @click="getCode">{{tips}}</u-button>

pages/componentsB/card/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<view class="">
33
<view class="u-card-wrap">
44
<u-card @click="click" @head-click="headClick" :title="title" :sub-title="subTitle" :thumb="thumb" :padding="padding" :border="border">
5-
<view class="" slot="body">
5+
<view class="" slot="body">
66
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
77
<view class="u-body-item-title u-line-2">
88
瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半

pages/componentsB/radio/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
list: [
6060
{
6161
name: '荔枝',
62-
checked: false,
62+
checked: true,
6363
disabled: false
6464
},
6565
{
@@ -81,7 +81,7 @@
8181
disabled: false,
8282
result: '',
8383
shape: 'square',
84-
value: '',
84+
value: '荔枝',
8585
activeColor: '#2979ff',
8686
size: 34,
8787
wrap: false,

pages/componentsB/search/index.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<view class="u-demo-area">
66
<u-toast ref="uToast"></u-toast>
77
<u-search v-model="value" @change="change" @custom="custom" @search="search" :shape="shape" :clearabled="clearabled"
8-
:show-action="showAction" :input-align="inputAlign"></u-search>
8+
:show-action="showAction" :input-align="inputAlign" @clear="clear"></u-search>
99
</view>
1010
</view>
1111
<view class="u-config-wrap">
@@ -83,6 +83,9 @@
8383
title: '搜索内容为:' + value,
8484
type: 'success'
8585
})
86+
},
87+
clear() {
88+
// console.log(this.value);
8689
}
8790
}
8891
}

pages/componentsB/swipeAction/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
onLoad() {
9090
setTimeout(() => {
9191
this.list = this.list1;
92-
}, 2000)
92+
}, 0)
9393
},
9494
methods: {
9595
disabledChange(index) {

pages/componentsC/numberBox/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
6464
},
6565
change(e) {
66-
// console.log(this.value);
66+
console.log(this.value);
6767
}
6868
}
6969
};

pages/componentsC/popup/index.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@
8383
// console.log('open');
8484
},
8585
btnClick() {
86-
console.log(this.show);
8786
this.show = true;
88-
console.log(this.show);
8987
}
9088
}
9189
}

0 commit comments

Comments
 (0)