import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
const routes: Array<RouteRecordRaw> = [
{
path: '/login',
name: 'login',
component: () => import('../components/LoginComponent.vue'),
},
{
path: '/register',
name: 'register',
component: () => import('../components/RegisterComponent.vue'),
},
];
this.$cookies.get('name')
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;
对象可能未定义 this
. 我也尝试过使用 this?.$cookies
但是它说 Property $cookies doesn't exist on type never
在vue路由器中还有哪些其他访问Cookie的方法?
暂无答案!
目前还没有任何答案,快来回答吧!