this.$router 拿到的就是我们创建的VueRouter对象 this.$route指的是当前活跃的路由所有的组件都继承自Vue类的原型Vue.prototype.test = function () {console.log(“test”);}