n0e
n0e

Reputation: 309

Fill vue-multiselect with router-links

I am trying to fill the vue-multiselect dropdown with <router-link> options. The usual way to specify router links to different components is declaratively in <template>, while vue-multiselect uses bind with options array. Any ideas how to go through with this?

I want to reuse vue-multiselect for navigation between components.

Upvotes: 3

Views: 446

Answers (1)

n0e
n0e

Reputation: 309

OK, after contacting Damian, developer of vue-multiselect, I've got the answer. The idea is to use the vue-multiselect as action dispatcher: https://vue-multiselect.js.org/#sub-action-dispatcher

You add

:reset-after="true"
@select=“navigateTo"

And in navigateTo you do this.$router.push({ path: 'xyz' }).

Upvotes: 1

Related Questions