yaminncco / vue-sidebar-menu

A Vue.js Sidebar Menu Component
MIT License
646 stars 194 forks source link

clarification on vue-router usage: "href" vs "to"? #191

Closed mmilano closed 3 years ago

mmilano commented 3 years ago

nice component. question about vue-router usage.

the docs for usage with vue-router are ambigious. they state:

 href: '/',
 /* with vue-router you can use :to prop
 href: { path: '/' }

which is interpreted on one line (#2) to mean that

but the next line (#3) example has the same href property, and using an actual to: property does not work.

working with vue-router would generally lead a person to expect to do something like....

menu: [
{
   to: {name: "accountProfile" params: { userId: '123' }},
   title: "Account Profile"
},
{
   href: "/"
   title: "home"
},
...
]

can you clarify this? are vue-router properties supposed to use a different, explicitly-named to property, or use the same href property no matter what router path object is used?

thanks.

yaminncco commented 3 years ago

Sorry if the documentation wasn't clear, with vue-router the href property can be a string or a location object

yaminncco commented 3 years ago

closing as answered

xlcrr commented 2 years ago

An example would be great, I am also confused about this