问题如图
明明浏览器url看到的path是/AppHome,但是使用this.$route.path或者location.pathname获取的path路径却是错误的‘/’,这是为什么呢?
问题出在当项目启动时,懒加载方式,路由加载注册的时候没有加载path:'/
AppHome'
下的$route
我当时是这样写的
这种方式写会导致出现这种情况,我们换种方式
( 在上面import了这个页面)
完美解决 ,path获取正确了
问题如图
明明浏览器url看到的path是/AppHome,但是使用this.$route.path或者location.pathname获取的path路径却是错误的‘/’,这是为什么呢?
问题出在当项目启动时,懒加载方式,路由加载注册的时候没有加载path:'/
AppHome'
下的$route
我当时是这样写的
这种方式写会导致出现这种情况,我们换种方式
( 在上面import了这个页面)
完美解决 ,path获取正确了