1:手动跳转路由的方式
window.location.href="http://localhost:8080/#/film"
this.$router.push("/film");
this.$router.push({
name:"film"
})
2:带参数的跳转
this.$router.push("/film/"+filmid);
this.$router.push({
name: "film",
params:{id:filmid}
});
3:如有页面需要带参数进入需要设置
{
path:"/film/:id",//带参数的路由
name:"film",
component:()=>import ("../views/Film.vue")
}
4:页面的参数取值
this.$route.params.id;