gpt4 book ai didi

javascript - 如何在 Vue 的输入表单中使用 selectize

转载 作者:行者123 更新时间:2023-11-28 17:52:31 25 4
gpt4 key购买 nike

假设我有一个输入字段:<input type="text" placeholder="Select Teams" />我应该能够选择 Support单击输入字段。

enter image description here

然后

enter image description here

我了解到使用 selectize 可以做到这一点。我应该如何将它合并为 vue 指令?

最佳答案

试试这个。

Vue.directive('selectize', function(el, binding){
var options = binding.value || {}
$(el).selectize(options)
})

然后在您想要的地方使用 v-selectize 指令。

您还可以添加更多选项。例如:

<input v-selectize="{maxItems: 3}" type="text" placeholder="Select Teams" />

关于javascript - 如何在 Vue 的输入表单中使用 selectize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45186268/

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