//注册全局方法
 
Vue.prototype.push = (url: string, closeTransition: boolean = false) => {
    //前进
    Vue.prototype.transitionName = "slide-left";
    this.$router.push(url);
};
 
Vue.prototype.pop = (n: number = -1, closeTransition: boolean = false) => {
    //后退
    Vue.prototype.transitionName = "slide-right";
 
    let path = this.$router.currentRoute.path;
    if (path == "/") {
        return;
    }
    this.$router.go(n);
};

 

Logo

前往低代码交流专区

更多推荐