router.js 437 Bytes

export function createYoRouter(router, store) {
    return {
        goBack(num) {
            // const backNum = Math.abs(num);
            // const {history} = store.state.yoho;

            // if (history.length > backNum) {
            //     const backRoute = history[history.length - (backNum + 1)];

            //     backRoute && router.push(backRoute.fullPath);
            // }
            router.go(num);
        }
    };
}