From 576b666ab2f80fbda1585388d9ad819d4b144f0b Mon Sep 17 00:00:00 2001 From: terwer Date: Tue, 23 May 2023 11:49:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=96=B0=E5=A2=9E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...76\350\256\241\346\200\235\350\267\257.md" | 14 +++++++ package.json | 5 ++- pnpm-lock.yaml | 16 ++++++++ src/App.vue | 18 +++++---- src/composables/useRouter.ts | 40 +++++++++++++++++++ src/main.ts | 5 +++ src/views/About.vue | 32 +++++++++++++++ src/views/Home.vue | 32 +++++++++++++++ tsconfig.json | 6 ++- vite.config.ts | 7 ++++ 10 files changed, 165 insertions(+), 10 deletions(-) create mode 100644 "docs/\350\256\276\350\256\241\346\200\235\350\267\257.md" create mode 100644 src/composables/useRouter.ts create mode 100644 src/views/About.vue create mode 100644 src/views/Home.vue diff --git "a/docs/\350\256\276\350\256\241\346\200\235\350\267\257.md" "b/docs/\350\256\276\350\256\241\346\200\235\350\267\257.md" new file mode 100644 index 0000000..f3cf34a --- /dev/null +++ "b/docs/\350\256\276\350\256\241\346\200\235\350\267\257.md" @@ -0,0 +1,14 @@ +1 主要页面 + +发布页面 + +发布设置 + +平台开关 + +平台管理 + +图床管理 + +偏好设置 + diff --git a/package.json b/package.json index 1369df6..b569869 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sy-post-publisher", "private": true, - "version": "0.0.0", + "version": "0.8.1", "type": "module", "scripts": { "serve": "vite", @@ -12,7 +12,8 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.2.47" + "vue": "^3.2.47", + "vue-router": "4" }, "devDependencies": { "@terwer/eslint-config-custom": "^1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b3d0b5..a500b92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,9 @@ dependencies: vue: specifier: ^3.2.47 version: 3.2.47 + vue-router: + specifier: '4' + version: 4.2.1(vue@3.2.47) devDependencies: '@terwer/eslint-config-custom': @@ -852,6 +855,10 @@ packages: '@vue/shared': 3.3.4 dev: true + /@vue/devtools-api@6.5.0: + resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} + dev: false + /@vue/reactivity-transform@3.2.47: resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==} dependencies: @@ -2638,6 +2645,15 @@ packages: - supports-color dev: true + /vue-router@4.2.1(vue@3.2.47): + resolution: {integrity: sha512-nW28EeifEp8Abc5AfmAShy5ZKGsGzjcnZ3L1yc2DYUo+MqbBClrRP9yda3dIekM4I50/KnEwo1wkBLf7kHH5Cw==} + peerDependencies: + vue: ^3.2.0 + dependencies: + '@vue/devtools-api': 6.5.0 + vue: 3.2.47 + dev: false + /vue-template-compiler@2.7.14: resolution: {integrity: sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==} dependencies: diff --git a/src/App.vue b/src/App.vue index 597d878..0139091 100644 --- a/src/App.vue +++ b/src/App.vue @@ -25,13 +25,6 @@ diff --git a/src/views/Home.vue b/src/views/Home.vue new file mode 100644 index 0000000..65e0daf --- /dev/null +++ b/src/views/Home.vue @@ -0,0 +1,32 @@ + + + + + + + diff --git a/tsconfig.json b/tsconfig.json index 33b454e..039e936 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,11 @@ "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, - "types": ["node", "vite/client"] + "types": ["node", "vite/client"], + + "paths": { + "~/*": ["./*"] + } }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "references": [{ "path": "./tsconfig.node.json" }] diff --git a/vite.config.ts b/vite.config.ts index 05b2cf1..98528a7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import livereload from "rollup-plugin-livereload" import minimist from "minimist" import fg from "fast-glob" import { createHtmlPlugin } from "vite-plugin-html" +import path from "path" const args = minimist(process.argv.slice(2)) const isWatch = args.watch || args.w || false @@ -64,6 +65,12 @@ export default defineConfig({ "process.env.DEV_MODE": `"${isWatch}"`, }, + resolve: { + alias: { + "~": path.resolve(__dirname, "./"), + }, + }, + build: { // 输出路径 outDir: distDir,