shentao/vue-multiselect

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

Open

#846 opened on Oct 8, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (994 forks)batch import
help wanted

Repository metrics

Stars
 (6,559 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide