Skip to content

Can i use virtual-select in nuxtjs? #110

Answered by sa-si-dev
erisvn asked this question in Q&A
Discussion options

You must be logged in to vote

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,

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@erisvn
Comment options

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
question Further information is requested
2 participants