依赖 vue-router
获得当前字符串,对应当前路由的路径,总是解析为绝对路径。
computed: { productIcon () { return this.imgMap[this.$route.path] } }
跳转到指定页面 使用router - link to:"/orderList" 可以,注意带/是定位到了根元素
this.$router.push({path: ‘/orderList‘})
原文:http://www.cnblogs.com/waitforyou/p/6790216.html