at-ui icon indicating copy to clipboard operation
at-ui copied to clipboard

自定义模态框确定按钮的回调

Open nszbf opened this issue 9 years ago • 1 comments

自定义模态框确定按钮的回调,同时也触发了on-cancel 事件? 自定义模态框

nszbf avatar Sep 20 '17 09:09 nszbf

      doClose () {
        this.visible = false
        this.$emit('input', false)
        this.$emit('on-cancel')
        if (this.action && this.callback) {
          this.callback(this.action, this)
        }
      },
      handleAction (action) {
        this.action = action
        if (action === 'confirm') {
          this.$emit('input', false)
          this.$emit('on-confirm')
        }
        this.doClose()
      },

doClose 中又执行了'on-cancel' 感觉还是要分开写吧

nszbf avatar Sep 21 '17 01:09 nszbf