Skip to content

Commit

Permalink
1. form表单验证新增toast的错误提示方式,配置erroryType=['toast']即可
Browse files Browse the repository at this point in the history
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事件的问题
  • Loading branch information
wlxuqu committed Jun 15, 2020
1 parent 3765301 commit 9e15c6c
Show file tree
Hide file tree
Showing 34 changed files with 576 additions and 459 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全
- 按需引入,精简打包体积


## 友情链接

<br>

#### **vue-admin-beautiful** —— [企业级、通用型中后台前端解决方案(基于vue/cli 4 最新版,同时支持电脑,手机,平板)](https://github.com/chuzhixin/vue-admin-beautiful)

#### **vue-admin-beautiful** —— [在线演示](http://beautiful.panm.cn/vue-admin-beautiful/#/index)
<br>

## 安装

```bash
Expand Down
4 changes: 4 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
// APP-VUE分包,可提APP升启动速度,2.7.12开始支持,兼容微信小程序分包方案,默认关闭
"optimization" : {
"subPackages" : true
},
"safearea" : {
"bottom" : {
"offset" : "none"
Expand Down
16 changes: 8 additions & 8 deletions pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [{
"name": "test", //模式名称
"path": "pages/template/citySelect/index", //启动页面,必选
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
}]
},
// "condition": { //模式配置,仅开发期间生效
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsB/swipeAction/index", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }]
// },
"pages": [
// 演示-组件
{
Expand Down
3 changes: 0 additions & 3 deletions pages/componentsA/empty/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<view class="u-demo-wrap">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<view class="u-no-demo-here">
滚动页面,在由下角即可看到返回顶部按钮
</view>
<u-empty :mode="mode">
<u-button v-if="slot" slot="bottom" size="medium">
slot按钮
Expand Down
31 changes: 23 additions & 8 deletions pages/componentsA/form/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</view>
<view class="u-config-item">
<view class="u-item-title">错误提示方式</view>
<u-subsection vibrateShort :list="['文字', '下划线', '输入框', '下划线+文字']" @change="errorChange"></u-subsection>
<u-subsection vibrateShort :list="['message', 'toast', '下划线', '输入框']" @change="errorChange"></u-subsection>
</view>
</view>
</view>
Expand Down Expand Up @@ -131,14 +131,32 @@ export default {
trigger: ['change','blur'],
},
{
// 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
validator: (rule, value, callback) => {
// 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
return this.$u.test.chinese(value);
},
message: '姓名必须为中文',
// 触发器可以同时用blur和change,二者之间用英文逗号隔开
trigger: ['change','blur'],
}
},
// 异步验证,用途:比如用户注册时输入完账号,后端检查账号是否已存在
// {
// trigger: ['blur'],
// // 异步验证需要通过调用callback(),并且在里面抛出new Error()
// // 抛出的内容为需要提示的信息,和其他方式的message属性的提示一样
// asyncValidator: (rule, value, callback) => {
// this.$u.post('/ebapi/public_api/index').then(res => {
// // 如果验证出错,需要在callback()抛出new Error('错误提示信息')
// if(res.error) {
// callback(new Error('姓名重复'));
// } else {
// // 如果没有错误,也要执行callback()回调
// callback();
// }
// })
// },
// }
],
sex: [
{
Expand Down Expand Up @@ -410,12 +428,9 @@ export default {
},
errorChange(index) {
if(index == 0) this.errorType = ['message'];
if(index == 1) this.errorType = ['border-bottom'];
if(index == 2) {
this.errorType = ['border'];
this.border = true;
}
if(index == 3) this.errorType = ['message', 'border-bottom'];
if(index == 1) this.errorType = ['toast'];
if(index == 2) this.errorType = ['border-bottom'];
if(index == 3) this.errorType = ['border'];
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion pages/componentsA/verificationCode/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode"
<u-verification-code :keep-running="true" :seconds="seconds" @end="end" @start="start" ref="uCode"
@change="codeChange" :startText="startText" :changeText="changeText"
:endText="endText"></u-verification-code>
<u-button @click="getCode">{{tips}}</u-button>
Expand Down
2 changes: 1 addition & 1 deletion pages/componentsB/card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<view class="">
<view class="u-card-wrap">
<u-card @click="click" @head-click="headClick" :title="title" :sub-title="subTitle" :thumb="thumb" :padding="padding" :border="border">
<view class="" slot="body">
<view class="" slot="body">
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
<view class="u-body-item-title u-line-2">
瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半
Expand Down
4 changes: 2 additions & 2 deletions pages/componentsB/radio/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
list: [
{
name: '荔枝',
checked: false,
checked: true,
disabled: false
},
{
Expand All @@ -81,7 +81,7 @@
disabled: false,
result: '',
shape: 'square',
value: '',
value: '荔枝',
activeColor: '#2979ff',
size: 34,
wrap: false,
Expand Down
5 changes: 4 additions & 1 deletion pages/componentsB/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<view class="u-demo-area">
<u-toast ref="uToast"></u-toast>
<u-search v-model="value" @change="change" @custom="custom" @search="search" :shape="shape" :clearabled="clearabled"
:show-action="showAction" :input-align="inputAlign"></u-search>
:show-action="showAction" :input-align="inputAlign" @clear="clear"></u-search>
</view>
</view>
<view class="u-config-wrap">
Expand Down Expand Up @@ -83,6 +83,9 @@
title: '搜索内容为:' + value,
type: 'success'
})
},
clear() {
// console.log(this.value);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pages/componentsB/swipeAction/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
onLoad() {
setTimeout(() => {
this.list = this.list1;
}, 2000)
}, 0)
},
methods: {
disabledChange(index) {
Expand Down
2 changes: 1 addition & 1 deletion pages/componentsC/numberBox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
},
change(e) {
// console.log(this.value);
console.log(this.value);
}
}
};
Expand Down
2 changes: 0 additions & 2 deletions pages/componentsC/popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@
// console.log('open');
},
btnClick() {
console.log(this.show);
this.show = true;
console.log(this.show);
}
}
}
Expand Down
Loading

0 comments on commit 9e15c6c

Please sign in to comment.