1.push(跳转到不同的url,但这个方法会向history栈添加一个记录,点击后退会返回到上一个页面。)
this.$router.push("/login")
this.$router.push({name: "login"})
entryDetails(id) {
const { href } = this.$router.resolve({
path: "/news_deatils",
query: {
id: id,
},
});
window.open(href, "_blank"); //打开新页面跳转
},
2.replace (这个方法不会向history里面添加新的记录,不会后退)
this.$router.replace("/login")