最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Disable options in v-autocomplete - Stack Overflow

programmeradmin3浏览0评论

How to disable options in v-autoplete? I did see this item-disabled and passed the string value of the option it didn't work. code snippet

<v-autoplete
    :items="states"
    item-text="name"
    label="State"
    item-disabled="Florida"
  ></v-autoplete>

How to disable options in v-autoplete? I did see this item-disabled and passed the string value of the option it didn't work. code snippet

<v-autoplete
    :items="states"
    item-text="name"
    label="State"
    item-disabled="Florida"
  ></v-autoplete>
Share Improve this question asked Oct 12, 2018 at 4:51 SamSam 2,4259 gold badges35 silver badges53 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6
<v-autoplete
    :items="states"
    item-text="name"
    label="State"
  ></v-autoplete>

Simply add a disabled prop to your Object:

 states: [
    {
      name: "New York", disabled: true
    },
    {
      name: "Florida"
    },
    {
      name: "Texas"
    },
  ]

You could populate that property dynamicly depending on what you want to be disabled.

https://codepen.io/anon/pen/yRXrJL?editors=1111

发布评论

评论列表(0)

  1. 暂无评论