shentao / vue-multiselect

Universal select/multiselect/tagging component for Vue.js
https://vue-multiselect.js.org/
MIT License
6.67k stars 989 forks source link

Vue-multiselect not select options after a nuxt $router.push, but works perfect when reload manually the page #846

Open filippolcr opened 5 years ago

filippolcr commented 5 years ago

https://jsfiddle.net/0f2enztx/

Steps to reproduce

Using Nuxt 2.0.0, Vue 2.5.17, Vue-Multiselect 2.1.0

In nuxt.config: plugins:[ ... '~/plugins/vue-multiselect', ... ] css: [ '~/assets/scss/main.scss', 'vue-multiselect/dist/vue-multiselect.min.css', ],

Look at jsfiddle to for the remaining part of the configuration.

Expected behaviour

Like the demo I expect that everything works fine, and jsfiddle prove exactly this.

Actual behaviour

I detect that when i navigate with this.$router.push method to the page that contains vue-multiselect html tag and I try to select an option, vue-dev-tool say to me that two events are dispatched: an input event with a payload (array) and a select event with payload (object - that is the category selected by the user),but the selected category is not highlighted by vue multiselect and is not selected.

Strange thing? When I reload manually the page this behavior disappear and everythings work weel.

Important notes

v-model is set on a computedProperty with only the get method implemented.

sbthemes commented 4 years ago

Same issue here.