配置 ng

在路由中添加
const router = createRouter({
history: createWebHistory('/analysis/'),
routes,
})
注意如果是ts文件的话,如果默认有生成js的话要查看对应的js是否有加上目录,否则设置会无效。
在vite.config.ts文件中添加
export default defineConfig({
base: '/exam/',
})
const router = createRouter({
history: createWebHistory('/analysis/'),
routes,
})
注意如果是ts文件的话,如果默认有生成js的话要查看对应的js是否有加上目录,否则设置会无效。
export default defineConfig({
base: '/exam/',
})
本文标题:vue3+vite history模式部署到服务器二级目录
本文链接:https://www.haomeiwen.com/subject/ypzebrtx.html
网友评论