路由模式分为 history 和 hash 两种模式,在 hash 模式下,使用 a 标签去跳转路由,可能会有问题。
比如:
<a href="/home"><img src="/logo.png" class="logo" /></a>
在跳转路由时,URL会出现这种情况:
修改之后:
<img src="/logo.png" class="logo" @click="goHome" />
路径始终是这样子正常的。
路由模式分为 history 和 hash 两种模式,在 hash 模式下,使用 a 标签去跳转路由,可能会有问题。
比如:
<a href="/home"><img src="/logo.png" class="logo" /></a>
在跳转路由时,URL会出现这种情况:
修改之后:
<img src="/logo.png" class="logo" @click="goHome" />
路径始终是这样子正常的。