在Modal做新增、修改的操作,启用loading状态。
点击确定后要是表单校验不通过,则确定按钮无法手动释放,不能再次点击。
刚好遇到过这个问题,我的解决方案是
changeLoading () {
this.loading = false
this.$nextTick(() => {
this.loading = true
})
},
ok () {
if (this.groupName.length === 0) {
// setTimeout(() => {
this.groupIsExist = '分组名不能为空'
this.changeLoading()
// }, 500)
我的解决办法是通过ref属性选中modal 然后把modal的buttonLoading设为false
const _modal = this.$refs.modal1;
_modal.buttonLoading = false
Hello, this issue has been closed because similar problems exist or have been explained in the documentation, please check carefully.
Most helpful comment
我的解决办法是通过ref属性选中modal 然后把modal的buttonLoading设为false
const _modal = this.$refs.modal1; _modal.buttonLoading = false