我想在中获取上一页链接或URL vue-router
。像这样 怎么做?
const link = this.$router.getPrevLink(); // function is not exist?
this.$router.push(link);
近概念是this.$router.go(-1)
。
this.$router.go(-1);
vue-router-如何获取上一页网址?
我想在中获取上一页链接或URL vue-router
。像这样 怎么做?
const link = this.$router.getPrevLink(); // function is not exist?
this.$router.push(link);
近概念是this.$router.go(-1)
。
this.$router.go(-1);
第1407篇《vue-router-如何获取上一页网址?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
相似问题
问题类别
所有vue-router的导航卫士都将前一条路线作为
from
参数接收..As an example you could use
beforeRouteEnter
, an in-component navigation guard, to get the previous route and store it in your data ..Then you can use
this.prevRoute.path
to get the previous URL.