bv中b-nav-item设置了to属性不能正常切换active

bv中b-nav-item设置了to属性不能正常切换active

bootstrap-vue的navbar 导航栏中的b-nav-item设置了to属性别不能正常切换active状态
解决:加上exact
<b-nav-item :to=”{name: ‘home’}” @click=”clickH…

bootstrap-vue的navbar 导航栏中的b-nav-item设置了to属性别不能正常切换active状态

解决:加上exact

<b-nav-item :to="{name: 'home'}" @click="clickHome" exact>Home</b-nav-item>
<b-nav-item :to="{name: 'about'}" @click="clickAbout" exact>About</b-nav-item>

参考:
https://github.com/bootstrap-vue/bootstrap-vue/issues/1096

https://bootstrap-vue.js.org/docs/reference/router-links/#exact

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×