D
D
DPS_ninja2019-11-19 15:49:07
JavaScript
DPS_ninja, 2019-11-19 15:49:07

How to activate the button when selecting an element in the table?

How to activate the button when selecting an element in the table and if not selected, then the button is not available? It seems there is an event, but it is impossible to hang up. Help me please.
Example:
https://codepen.io/Vkondr/pen/vYYbgoz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-11-19
@DPS_ninja

There is already a property containing the selected elements - great, using it, you can make a calculated property that controls the activity of the button:
<v-btn :disabled="disabled"

computed: {
  disabled() {
    return !this.selected.length;
  },
},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question