-
Can I use virtual-select in nuxtjs project? If possible, can you give me an example? |
Beta Was this translation helpful? Give feedback.
Answered by
sa-si-dev
Apr 16, 2022
Replies: 2 comments 1 reply
-
I am not familiar with Nuxt js. But it seems, it is possible as per the sample code in the issue #105 (comment) I will try Nuxt js and share the sample code. |
Beta Was this translation helpful? Give feedback.
1 reply
-
A sample code is taken from #105 (comment) export default {
name: "VirtualSelect",
props: {
options: { type: Array, default: () => [] },
valueKey: { type: String, default: "label" },
labelKey: { type: String, default: "value" },
descriptionKey: { type: String, default: "description" },
aliasKey: { type: String, default: "alias" }
},
watch: {
options(array) {
this.init(array);
}
},
mounted() {
this.init();
},
methods: {
init(options = []) {
const { valueKey, labelKey, descriptionKey, aliasKey } = this;
VirtualSelect.init({
ele: "#virtual-select",
placeholder: "请选择...",
options,
search: true,
multiple: true,
valueKey,
labelKey,
descriptionKey,
selectedValue: ["4002793", "1000102580"]
});
},
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sa-si-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A sample code is taken from #105 (comment)