Vuejs disabled selected dropdown options?

后端 未结 1 1770
梦毁少年i
梦毁少年i 2021-01-19 16:18

I have an array selected which holds a set of selected options. I\'d like to use that array to add a disabled attribute on those options.



        
相关标签:
1条回答
  • 2021-01-19 16:54

    You want to disable all options that are in the selected array?

    <option v-for="option in options" :disabled="selected.includes(option.value)" :value="option.value">
    
    0 讨论(0)
提交回复
热议问题