Skip to content

Dou-D/v3-oj

Repository files navigation

sylu-oj

This template should help get you started developing with Vue 3 in Vite.

Recommended IDE Setup

VSCode + Volar (and disable Vetur).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Compile and Minify for Production

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 了的话)

解决方案 1(推荐)

userStore.addAdminRoutes(); //获取到后端返回值,添加到路由
return next(to.fullPath); // 在这块重新访问该路由

解决方案 2

if (!to.redirectedFrom) {
  return next({ ...to, replace: true }); 
}

redirectedFrom
当你对某些路由有重定向功能,例如'/'定向到'/home',如果此时访问'/',此时输出的to中,就包含redirectedFrom

Vue中配置sass无需再装sass-loader

npm install -D sass

一条命令搞定

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages