clarification on vue-router usage: "href" vs "to"?
mmilano opened this issue · comments
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
- if creating a regular plain old html link, use
href:
- if using vue-router to make a router-aware link, use
to:
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.
Sorry if the documentation wasn't clear, with vue-router the href property can be a string or a location object
closing as answered
An example would be great, I am also confused about this