This template should help get you started developing with Vue 3 in Vite.
VSCode + Volar (and disable Vetur).
See Vite Configuration Reference.
npm install
npm run dev
npm run build
store 中导出的 ref,不需要再通过.value
来访问
Router.addRoute(parentName: RouteRecordName, route: RouteRecordRaw): () => void (+1 overload)
解释: Add a new route record as the child of an existing route.
@param parentName — Parent Route Record where route should be appended at
@param route — Route Record to add
刷新权限路由造成白屏或404(如果你配置 404 了的话)
userStore.addAdminRoutes(); //获取到后端返回值,添加到路由
return next(to.fullPath); // 在这块重新访问该路由
if (!to.redirectedFrom) {
return next({ ...to, replace: true });
}
redirectedFrom
当你对某些路由有重定向功能,例如'/'定向到'/home',如果此时访问'/',此时输出的to中,就包含redirectedFrom
npm install -D sass
一条命令搞定