Iview: Modal启用loading后确定按钮如何手动释放

Created on 29 Sep 2017  ·  3Comments  ·  Source: iview/iview

在Modal做新增、修改的操作,启用loading状态。
点击确定后要是表单校验不通过,则确定按钮无法手动释放,不能再次点击。

Most helpful comment

我的解决办法是通过ref属性选中modal 然后把modal的buttonLoading设为false
const _modal = this.$refs.modal1; _modal.buttonLoading = false

All 3 comments

刚好遇到过这个问题,我的解决方案是

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lichinlichin picture lichinlichin  ·  3Comments

ai116458960 picture ai116458960  ·  3Comments

sunyifeng520 picture sunyifeng520  ·  3Comments

istommao picture istommao  ·  3Comments

blankxf picture blankxf  ·  3Comments