【发布时间】:2021-05-20 07:51:28
【问题描述】:
我正在尝试为我的设置页面设置路由器链接,每当我点击帐户时,它会将我定向到 localhost/account 而不是 localhost/settings/account 我已经为设置页面提供了孩子,为什么会发生这种情况?
Settings.vue
router-link(to="/")
button(class='hover:text-blue-500 focus:outline-none')
| Profile
router-link(:to="{name: 'Account'}")
button(class='hover:text-blue-500 focus:outline-none')
| Account
router-view
{
path: "/settings",
name: "Settings",
component: Settings,
children: [{
path: "",
name: "Profile",
component: Profile
},
{
path: "/account",
name: "Account",
component: Account
}
]
},
【问题讨论】:
标签: vue.js vuejs2 vue-router