yariksav / vuetify-dialog

Easy dialogs in Vuetify.js framework
MIT License
195 stars 48 forks source link

disabled action button #141

Closed bugbiter closed 2 years ago

bugbiter commented 2 years ago

Is it possible to set an action button's disabled property, e.g. when validating a form in the dialog. This doesn't work:

computed: {
    actions() {
      return [
        {
          text: this.$t('system.cancel'),
          key: false
        },
        {
          text: this.$t('system.select'),
          disabled: !this.valid, //true
          handle: () => this.select()
        }
      ]
    }
  }
yariksav commented 2 years ago

hello, what version do you use? handle now is deprecated, please use handler And yes, you can disable the button by setting param disabled with type boolean or function

disable: true .. or
disable: () => {
   return ture
}  

https://github.com/yariksav/vuetify-dialog/blob/15d5e0a7dea006ef3d6b2a6c58a14fc6491905ac/src/components/DialogAction.vue#L7

https://github.com/yariksav/vuedl/blob/d9a1527801d270616600abdcac202b64bbfc80bc/src/mixins/actionable.js#L87

bugbiter commented 2 years ago

I am using latest. My bad. It does actually work setting disabled on an action. I had a couple of other issues going on.