1.点击事件跳转
//路由中配置
{
path: '/examCenter/',
name: 'examCenter',
component: () => import(/* webpackChunkName: "about" */ '../views/examCenter.vue'),
prop:true,
},
//点击事件触发
<img src="../img/1.jpg" class="imgs" @click="hosService" />
//方法调用
methods: {
examCenter() {
this.$router.push("/examCenter") },
}
2.标签跳转
<router-link to='two'><button>点我到第二个页面</button></router-link>
来源:CSDN
作者:☕fairylandqaq
链接:https://blog.csdn.net/qq_39396379/article/details/103578691