vue-navigation-bar
vue-navigation-bar copied to clipboard
router links with parameters
I am dynamically creating a dropdown menu and need to have params passed to the router-link.
Ive found in DynamicLink.vue the following code:
return h(
"router-link",
{ props: { to: { name: this.path.name } } },
this.$slots.default
);
This could accomodate params with:
return h(
"router-link",
{ props: { to: this.path } },
this.$slots.default
);
Then we could define the params like
path:{name:"this-route",params:{item:thisItem}
Forgive me if there another predefined way of doing this with vue-navigation-bar, I couldn't find one.
I think this is a good idea and I think you're right with your suggestion. Would you mind putting up a PR and confirming it works? If you don't have the time let me know - I'll get it in.