update config
This commit is contained in:
parent
e6fcf38f62
commit
8bb882287f
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user