update config

This commit is contained in:
midfar 2023-03-09 10:44:33 +08:00
parent e6fcf38f62
commit 8bb882287f
2 changed files with 3 additions and 1 deletions

View File

@ -389,6 +389,8 @@ export const asyncRoutes = [
const createTheRouter = () => createRouter({ const createTheRouter = () => createRouter({
// history: createWebHashHistory(import.meta.env.BASE_URL), // history: createWebHashHistory(import.meta.env.BASE_URL),
// 注意,如果要配置 HTML5 模式则需要修改nginx配置参考资料
// https://router.vuejs.org/zh/guide/essentials/history-mode.html
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
scrollBehavior: () => ({ top: 0 }), scrollBehavior: () => ({ top: 0 }),
routes: constantRoutes routes: constantRoutes

View File

@ -20,7 +20,7 @@ export default defineConfig(({ command, mode }) => {
const prodMock = true; const prodMock = true;
return { return {
base: '/', // hash模式配置"./"url模式配置"/" base: './', // 注意,必须以"/"结尾
define: { define: {
'process.env': env 'process.env': env
}, },