[Vuejs]-How to pass default value in multiselect component to another vue-multiselect

0👍

In template:

<multiselect v-model="multiSelect1" :options="options" @input="onChange"></multiselect>
<multiselect v-model="multiSelect2" :options="options" :placeholder="placeholder"></multiselect>

In script:

data: () => ({
    multiSelect1: "",
    multiSelect2: "",
    options: ["list", "of", "options"],
    placeholder: "Select option"
}),
methods: {
    onChange() {
      this.multiSelect2 = this.multiSelect1
    }
}

Please check this codesandbox: https://codesandbox.io/s/vue-template-t226h

Leave a comment