优化表单校验
This commit is contained in:
parent
b6ea349217
commit
201fed4ae0
@ -101,13 +101,8 @@
|
||||
this.initProvinceAndCity();
|
||||
},
|
||||
methods:{
|
||||
validate(){
|
||||
return new Promise((resolve, reject)=>{
|
||||
this.$refs.districtForm.validate().then(res=>{
|
||||
if(res)resolve(true);
|
||||
else reject(false);
|
||||
})
|
||||
})
|
||||
async validate(){
|
||||
return await this.$refs.districtForm.validate();
|
||||
},
|
||||
// 初始化
|
||||
async initProvinceAndCity() {
|
||||
|
@ -138,13 +138,8 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validate() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$refs.residentsForm.validate().then(res => {
|
||||
if (res) resolve(true);
|
||||
else reject(false);
|
||||
})
|
||||
})
|
||||
async validate() {
|
||||
return this.$refs.residentsForm.validate();
|
||||
},
|
||||
// 选择生日
|
||||
changebirth_time(e) {
|
||||
|
@ -150,9 +150,9 @@
|
||||
async addArchives() {
|
||||
Toast('开发中')
|
||||
let flag = true;
|
||||
// flag = await this.$refs.districtSelectorRef.validate();
|
||||
// if(flag) flag = await this.$refs.residentsRef.validate();
|
||||
if(flag) flag = await this.$refs.breedingRef.validate();
|
||||
flag = this.$refs.districtSelectorRef.validate();
|
||||
if(flag) flag = this.$refs.residentsRef.validate();
|
||||
if(flag) flag = this.$refs.breedingRef.validate();
|
||||
if(flag) this.$refs.archives.validate().then(async (e) => {
|
||||
if (e) {
|
||||
uni.showLoading()
|
||||
|
Loading…
x
Reference in New Issue
Block a user