this.$validator.validateAll().then((result)=>{
if(result){
// 提交數據
$.post(url, datas, xhr => {
this.$store.commit(MESSAGE, {
status: 'success',
text: '操作成功了!'
})
})
}
})
- this.$validator.validateAll()校驗所有,只要有一個校驗失敗了,就返回false
