一、this.$route

this.$route.path为页面的路由路径
二、location

location.pathname 和this.$route.path效果相同
本文介绍了Vue.js中this.$route.path属性与浏览器location.pathname属性的使用方法,两者均可获取当前页面的路由路径。
一、this.$route

this.$route.path为页面的路由路径
二、location

location.pathname 和this.$route.path效果相同
1839
300

被折叠的 条评论
为什么被折叠?
