b-nav-item / b-link problem with HMR
See original GitHub issueWhile testing out the b-navbar
component and messing with vue-router’s :to
attribute, i noticed a really weird behaviour.
At first i noticed that trying to do an object based link via the name property (like :to="{name: 'home'}"
), it produced a link like localhost/[object Object]
. From there i just assumed that it was failing to pass the object to the internal router-link
correctly, so i just switched to a simple string (Like to="/"
).
However, when messing around seeing how hard it would be to replicate the behaviour of the b-nav-item
component using the router-link
component, i noticed that the link started working properly when i copied the configuration from router-link
to b-nav-item
, but only when the component was injected via HMR…
I’m not entirely sure on what the exact reproduction steps are, however it appears to be a combination of Hot Module Reloading, and editing the :to
property of the b-nav-item
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
You are right. fixed.
@mosinve The main idea behind using hrefString fallback was SSR problems with older vue-router. There are more than problems than its benefits forcing href or deduction it’s value based on to prop. (For example it causes invalid links when we are prefixing urls)