Доступ к ssrContext в vue маршрутизаторе - PullRequest
0 голосов
/ 24 апреля 2020

Я использую квазар с vue -cli-3 в режиме ssr. Я пытаюсь получить доступ к ssrContext, чтобы сохранить куки-файлы, но я не понял, как это сделать. Вот код ¿Есть идеи?

const routes: RouteConfig[] = [
    {
        path: "/",
        component: () => import("layouts/MainLayout.vue"),
        children: [{ name: "home", path: "", component: () => import("pages/Index.vue") }]
    },
    {
        path: "/direcciones/guardar",
        component: () => import("layouts/MainLayout.vue"),
        children: [{ path: "", component: () => import("pages/SaveAddress.vue") }]
    },
    {
        path: "/direcciones",
        component: () => import("layouts/MainLayout.vue"),
        children: [{ path: "", component: () => import("pages/ListAddress.vue") }]
    },
    {
        path: "/bienvenido/paso-:step",
        component: () => import("layouts/MainLayout.vue"),
        children: [
            {
                path: "",
                props: true,
                name: "welcome",
                component: () => import("pages/WelcomeSteps.vue"),
                beforeEnter: (to, from, next) => {
                    //Here i need to access ssrContext
                    return next();
                },
                children: []
            }
        ]
    }
];

...