diff --git a/404.html b/404.html index c5b1a05..7db093f 100644 --- a/404.html +++ b/404.html @@ -1,12 +1,14 @@ - + + + + - - + JM Expense diff --git a/deploy.sh b/deploy.sh index b9bd1f7..fc80fcf 100755 --- a/deploy.sh +++ b/deploy.sh @@ -14,7 +14,7 @@ cd dist git init git add -A -git commit -m 'deploy' +git commit -m 'deploy: config' # if you are deploying to https://.github.io # git push -f https://github.com//.GitHub.io.git master diff --git a/index.html b/index.html index 720c997..e95d5af 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,13 @@ - + + + - - + JM Expense diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..0b46e1a --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,14 @@ +module.exports = { + plugins: [ + { + postcssPlugin: 'internal:charset-removal', + AtRule: { + charset: (atRule) => { + if (atRule.name === 'charset') { + atRule.remove() + } + } + } + } + ] +} diff --git a/src/router/index.ts b/src/router/index.ts index d4c490b..2e5b125 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,13 +5,165 @@ import AppLayout from '@/views/App.vue' const root = '/jm-expense-vue-ts' +// export const routes: RouteRecordRaw[] = [ +// { +// path: '/', +// redirect: `${root}/` +// }, +// { +// path: `${root}/register`, +// name: 'Register', +// component: () => import('../views/Register.vue'), +// meta: { +// pageTitle: '註冊頁', +// show: false +// } +// }, +// { +// path: `${root}/login`, +// name: 'Login', +// component: () => import('../views/Login.vue'), +// meta: { +// pageTitle: '登入頁', +// show: false +// } +// }, +// { +// path: `${root}/`, +// name: 'Home', +// component: () => import('../views/Home.vue'), +// meta: { +// pageTitle: '首頁', +// show: true +// } +// }, +// { +// path: `${root}/record`, +// name: 'Record', +// component: () => import('../views/Record.vue'), +// meta: { +// pageTitle: '未結算紀錄', +// show: true +// } +// }, +// { +// path: `${root}/closedRecord`, +// name: 'ClosedRecord', +// component: () => import('../views/ClosedRecord.vue'), +// meta: { +// pageTitle: '已結算紀錄', +// show: true +// } +// }, +// { +// path: `${root}/logs`, +// name: 'Logs', +// component: () => import('../views/Logs.vue'), +// meta: { +// pageTitle: '更動紀錄', +// show: true +// } +// }, +// { +// path: `${root}/expense`, +// name: 'Expense', +// component: () => import('../views/Expense.vue'), +// meta: { +// pageTitle: '豬涵記帳', +// show: true +// } +// }, +// // { +// // path: `${root}/tools`, +// // name: 'Tools', +// // component: () => import('../views/Tools.vue'), +// // meta: { +// // pageTitle: '小工具', +// // show: true +// // } +// // }, +// { +// path: `${root}/game`, +// name: 'Game', +// component: () => import('../views/Game.vue'), +// meta: { +// pageTitle: '小遊戲', +// show: true +// // auth: ['root', 'admin', 'member'] +// } +// }, +// // { +// // path: `${root}/admin`, +// // name: 'Admin', +// // redirect: { name: 'Admin-Role' }, +// // component: AppLayout, +// // meta: { +// // pageTitle: '管理面板', +// // show: true +// // }, +// // children: [ +// // { +// // path: 'role', +// // name: 'Admin-Role', +// // component: () => import('../views/Role.vue'), +// // meta: { +// // pageTitle: '角色管理', +// // show: true +// // } +// // }, +// // { +// // path: 'permission', +// // name: 'Admin-Permission', +// // component: () => import('../views/Permission.vue'), +// // meta: { +// // pageTitle: '權限管理', +// // show: true +// // } +// // } +// // ] +// // }, +// // { +// // path: `${root}/admin/role`, +// // name: 'Admin-Role', +// // component: () => import('@/views/Role.vue'), +// // meta: { +// // pageTitle: '角色管理', +// // show: true +// // } +// // }, +// // { +// // path: '/admin/role/:id/access', +// // name: 'Admin-Role-Access', +// // component: () => import('@/views/Access.vue'), +// // meta: { +// // pageTitle: '角色管理 / 設置權限[角色名稱]', +// // show: false +// // } +// // }, +// // { +// // path: '/admin/permission', +// // name: 'Admin-Permission', +// // component: () => import('../views/Permission.vue'), +// // meta: { +// // pageTitle: '權限管理', +// // show: true +// // } +// // }, +// { +// path: '/:pathMatch(.*)*', +// name: 'NotFound', +// component: () => import('../views/NotFound.vue') +// } +// ] + +// new export const routes: RouteRecordRaw[] = [ + // { + // path: '/', + // redirect: `${root}/` + // }, { - path: '/', - redirect: `${root}/` - }, - { - path: `${root}/register`, + path: '/register', name: 'Register', component: () => import('../views/Register.vue'), meta: { @@ -20,7 +172,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/login`, + path: '/login', name: 'Login', component: () => import('../views/Login.vue'), meta: { @@ -29,7 +181,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/`, + path: '/', name: 'Home', component: () => import('../views/Home.vue'), meta: { @@ -38,7 +190,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/record`, + path: '/record', name: 'Record', component: () => import('../views/Record.vue'), meta: { @@ -47,7 +199,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/closedRecord`, + path: '/closedRecord', name: 'ClosedRecord', component: () => import('../views/ClosedRecord.vue'), meta: { @@ -56,7 +208,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/logs`, + path: '/logs', name: 'Logs', component: () => import('../views/Logs.vue'), meta: { @@ -65,7 +217,7 @@ export const routes: RouteRecordRaw[] = [ } }, { - path: `${root}/expense`, + path: '/expense', name: 'Expense', component: () => import('../views/Expense.vue'), meta: { @@ -74,7 +226,7 @@ export const routes: RouteRecordRaw[] = [ } }, // { - // path: `${root}/tools`, + // path: '/tools', // name: 'Tools', // component: () => import('../views/Tools.vue'), // meta: { @@ -83,7 +235,7 @@ export const routes: RouteRecordRaw[] = [ // } // }, { - path: `${root}/game`, + path: '/game', name: 'Game', component: () => import('../views/Game.vue'), meta: { diff --git a/src/views/App.vue b/src/views/App.vue index 3f9e6e9..dc0c712 100644 --- a/src/views/App.vue +++ b/src/views/App.vue @@ -5,7 +5,7 @@ import { useRoute } from 'vue-router' const route = useRoute() // created -if (import.meta.env.NODE_ENV === 'production') { +if (import.meta.env.MODE === 'production') { onLoad() } diff --git a/vite.config.js b/vite.config.js index 6853f05..1d6ebce 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,5 +14,8 @@ export default defineConfig({ }, server: { port: 8080 - } + }, + // base: import.meta.env.DEV ? '/' : '/jm-expense-vue-ts/' + // base: '/jm-expense-vue-ts/' + base: './' }) diff --git a/vue.config.js b/vue.config.js deleted file mode 100644 index 9291b72..0000000 --- a/vue.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - // publicPath: process.env.NODE_ENV === 'production' ? '/jm-expense-vue-ts/' : '/' - publicPath: import.meta.env.NODE_ENV === 'production' ? '/jm-expense-vue-ts/' : '/' -}