How to use the vue-router.default.prototype function in vue-router

To help you get started, we’ve selected a few vue-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github presentator / presentator / packages / xd / src / main.js View on Github external
const styles             = require('@/styles.css');
const Vue                = require('vue').default;
const VueRouter          = require('vue-router').default;
const ApiClient          = require('@/utils/ApiClient');
const VueHelper          = require('@/utils/VueHelper.js');
const App                = require('@/App.vue').default;
const RouteAuth          = require('@/RouteAuth.vue').default;
const RouteExport        = require('@/RouteExport.vue').default;
const RouteExportSuccess = require('@/RouteExportSuccess.vue').default;

Vue.config.productionTip = false;

// silent noisy uncaught router promise errors
// https://github.com/vuejs/vue-router/issues/2881
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location, onResolve, onReject) {
    if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject);
    return originalReplace.call(this, location).catch(err => err);
}

Vue.use(VueRouter);

Vue.use(VueHelper);

const router = new VueRouter({
    routes: [
        {
            path:      '/',
            name:      'auth',
            component: RouteAuth,
        },
github presentator / presentator / packages / xd / src / main.js View on Github external
const styles             = require('@/styles.css');
const Vue                = require('vue').default;
const VueRouter          = require('vue-router').default;
const ApiClient          = require('@/utils/ApiClient');
const VueHelper          = require('@/utils/VueHelper.js');
const App                = require('@/App.vue').default;
const RouteAuth          = require('@/RouteAuth.vue').default;
const RouteExport        = require('@/RouteExport.vue').default;
const RouteExportSuccess = require('@/RouteExportSuccess.vue').default;

Vue.config.productionTip = false;

// silent noisy uncaught router promise errors
// https://github.com/vuejs/vue-router/issues/2881
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location, onResolve, onReject) {
    if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject);
    return originalReplace.call(this, location).catch(err => err);
}

Vue.use(VueRouter);

Vue.use(VueHelper);

const router = new VueRouter({
    routes: [
        {
            path:      '/',
            name:      'auth',
            component: RouteAuth,
        },
        {