gpt4 book ai didi

javascript - 禁用 v-autocomplete 中的选项

转载 作者:行者123 更新时间:2023-12-02 03:27:36 25 4
gpt4 key购买 nike

如何禁用 v-autocomplete 中的选项?我确实看到了这个 item-disabled 并传递了它不起作用的选项的字符串值。代码片段

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

最佳答案

<v-autocomplete
:items="states"
item-text="name"
label="State"
></v-autocomplete>

只需向您的对象添加一个 disabled Prop :

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

您可以根据要禁用的内容动态填充该属性。

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

关于javascript - 禁用 v-autocomplete 中的选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52772475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com