【发布时间】:2020-03-27 13:00:37
【问题描述】:
在我的 Vue 应用程序中,我有以下路线(以及其他路线)
{
path: '/event/:eventId?',
name: 'event',
component: EventTask
},
{
path: '/terms-and-conditions',
name: 'terms-and-conditions',
component: TermsAndConditions
}
条款和条件的链接显示在页脚中,因此可以从任何页面访问。如果我在活动路线上,我点击条款和条件的链接
<router-link to="terms-and-conditions">
<v-btn text>Terms of Use</v-btn>
</router-link>
浏览器导航到路径/event/terms-and-conditions,而不是/terms-and-conditions。我怎样才能使它成为一条绝对路线,所以它总是导航到/terms-and-conditions?
【问题讨论】:
标签: vue.js vue-router