vue 获取地址栏的各个部分内容

vue 获取地址栏的各个部分内容

vue中常用到的就是 this.$route this.$route.query
但是this.$route 到底是啥
打印一下

console.log(this.$route)

结果:
在这里插入图片描述
可以看出 this.$route 是一个对象,包含parmas、query、fullpath、path等等
想要什么部分直接对应的取值就可以了。

猜你喜欢

转载自blog.csdn.net/MtangEr/article/details/87812025