From d50ca7060123d0a6289bc4ea258c5f1c2e75cd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=95=BF=E7=A9=BA?= <10753139+fang-zifu@user.noreply.gitee.com> Date: Fri, 23 Feb 2024 16:31:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 3 + package-lock.json | 15 ++++ package.json | 1 + src/App.vue | 81 +------------------- src/assets/base.css | 86 --------------------- src/assets/logo.svg | 1 - src/assets/main.css | 35 --------- src/components/HelloWorld.vue | 41 ---------- src/components/TheWelcome.vue | 88 ---------------------- src/components/WelcomeItem.vue | 87 --------------------- src/components/icons/IconCommunity.vue | 7 -- src/components/icons/IconDocumentation.vue | 7 -- src/components/icons/IconEcosystem.vue | 7 -- src/components/icons/IconSupport.vue | 7 -- src/components/icons/IconTooling.vue | 19 ----- src/main.ts | 12 ++- src/router/index.ts | 17 ++--- src/stores/counter.ts | 12 --- src/views/AboutView.vue | 15 ---- src/views/HomeView.vue | 9 --- src/views/index.vue | 8 ++ 21 files changed, 44 insertions(+), 514 deletions(-) delete mode 100644 src/assets/base.css delete mode 100644 src/assets/logo.svg delete mode 100644 src/assets/main.css delete mode 100644 src/components/HelloWorld.vue delete mode 100644 src/components/TheWelcome.vue delete mode 100644 src/components/WelcomeItem.vue delete mode 100644 src/components/icons/IconCommunity.vue delete mode 100644 src/components/icons/IconDocumentation.vue delete mode 100644 src/components/icons/IconEcosystem.vue delete mode 100644 src/components/icons/IconSupport.vue delete mode 100644 src/components/icons/IconTooling.vue delete mode 100644 src/stores/counter.ts delete mode 100644 src/views/AboutView.vue delete mode 100644 src/views/HomeView.vue create mode 100644 src/views/index.vue diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6f40582..0fdfb7f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -11,5 +11,8 @@ module.exports = { ], parserOptions: { ecmaVersion: 'latest' + }, + rules: { + "vue/multi-word-component-names" : 'off' } } diff --git a/package-lock.json b/package-lock.json index 4f5ac3f..c193983 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "pinia": "^2.1.7", + "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.4.15", "vue-router": "^4.2.5" }, @@ -2397,6 +2398,14 @@ } } }, + "node_modules/pinia-plugin-persistedstate": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz", + "integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==", + "peerDependencies": { + "pinia": "^2.0.0" + } + }, "node_modules/pinia/node_modules/vue-demi": { "version": "0.14.7", "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz", @@ -4628,6 +4637,12 @@ } } }, + "pinia-plugin-persistedstate": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz", + "integrity": "sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==", + "requires": {} + }, "postcss": { "version": "8.4.35", "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.35.tgz", diff --git a/package.json b/package.json index 8634d55..fed7092 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ }, "dependencies": { "pinia": "^2.1.7", + "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.4.15", "vue-router": "^4.2.5" }, diff --git a/src/App.vue b/src/App.vue index 7905b05..f021b88 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,85 +1,8 @@ - - - diff --git a/src/assets/base.css b/src/assets/base.css deleted file mode 100644 index 8816868..0000000 --- a/src/assets/base.css +++ /dev/null @@ -1,86 +0,0 @@ -/* color palette from */ -:root { - --vt-c-white: #ffffff; - --vt-c-white-soft: #f8f8f8; - --vt-c-white-mute: #f2f2f2; - - --vt-c-black: #181818; - --vt-c-black-soft: #222222; - --vt-c-black-mute: #282828; - - --vt-c-indigo: #2c3e50; - - --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); - --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); - --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); - --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); - - --vt-c-text-light-1: var(--vt-c-indigo); - --vt-c-text-light-2: rgba(60, 60, 60, 0.66); - --vt-c-text-dark-1: var(--vt-c-white); - --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); -} - -/* semantic color variables for this project */ -:root { - --color-background: var(--vt-c-white); - --color-background-soft: var(--vt-c-white-soft); - --color-background-mute: var(--vt-c-white-mute); - - --color-border: var(--vt-c-divider-light-2); - --color-border-hover: var(--vt-c-divider-light-1); - - --color-heading: var(--vt-c-text-light-1); - --color-text: var(--vt-c-text-light-1); - - --section-gap: 160px; -} - -@media (prefers-color-scheme: dark) { - :root { - --color-background: var(--vt-c-black); - --color-background-soft: var(--vt-c-black-soft); - --color-background-mute: var(--vt-c-black-mute); - - --color-border: var(--vt-c-divider-dark-2); - --color-border-hover: var(--vt-c-divider-dark-1); - - --color-heading: var(--vt-c-text-dark-1); - --color-text: var(--vt-c-text-dark-2); - } -} - -*, -*::before, -*::after { - box-sizing: border-box; - margin: 0; - font-weight: normal; -} - -body { - min-height: 100vh; - color: var(--color-text); - background: var(--color-background); - transition: - color 0.5s, - background-color 0.5s; - line-height: 1.6; - font-family: - Inter, - -apple-system, - BlinkMacSystemFont, - 'Segoe UI', - Roboto, - Oxygen, - Ubuntu, - Cantarell, - 'Fira Sans', - 'Droid Sans', - 'Helvetica Neue', - sans-serif; - font-size: 15px; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} diff --git a/src/assets/logo.svg b/src/assets/logo.svg deleted file mode 100644 index 7565660..0000000 --- a/src/assets/logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/assets/main.css b/src/assets/main.css deleted file mode 100644 index 36fb845..0000000 --- a/src/assets/main.css +++ /dev/null @@ -1,35 +0,0 @@ -@import './base.css'; - -#app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - font-weight: normal; -} - -a, -.green { - text-decoration: none; - color: hsla(160, 100%, 37%, 1); - transition: 0.4s; - padding: 3px; -} - -@media (hover: hover) { - a:hover { - background-color: hsla(160, 100%, 37%, 0.2); - } -} - -@media (min-width: 1024px) { - body { - display: flex; - place-items: center; - } - - #app { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0 2rem; - } -} diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue deleted file mode 100644 index 38d821e..0000000 --- a/src/components/HelloWorld.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/src/components/TheWelcome.vue b/src/components/TheWelcome.vue deleted file mode 100644 index 49d8f73..0000000 --- a/src/components/TheWelcome.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/src/components/WelcomeItem.vue b/src/components/WelcomeItem.vue deleted file mode 100644 index 6d7086a..0000000 --- a/src/components/WelcomeItem.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - diff --git a/src/components/icons/IconCommunity.vue b/src/components/icons/IconCommunity.vue deleted file mode 100644 index 2dc8b05..0000000 --- a/src/components/icons/IconCommunity.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/icons/IconDocumentation.vue b/src/components/icons/IconDocumentation.vue deleted file mode 100644 index 6d4791c..0000000 --- a/src/components/icons/IconDocumentation.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/icons/IconEcosystem.vue b/src/components/icons/IconEcosystem.vue deleted file mode 100644 index c3a4f07..0000000 --- a/src/components/icons/IconEcosystem.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/icons/IconSupport.vue b/src/components/icons/IconSupport.vue deleted file mode 100644 index 7452834..0000000 --- a/src/components/icons/IconSupport.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/icons/IconTooling.vue b/src/components/icons/IconTooling.vue deleted file mode 100644 index 660598d..0000000 --- a/src/components/icons/IconTooling.vue +++ /dev/null @@ -1,19 +0,0 @@ - - diff --git a/src/main.ts b/src/main.ts index 5dcad83..f670b2b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,14 +1,20 @@ -import './assets/main.css' - import { createApp } from 'vue' import { createPinia } from 'pinia' import App from './App.vue' import router from './router' +import Persistedstate from 'pinia-plugin-persistedstate' +// 注册应用实例 const app = createApp(App) -app.use(createPinia()) +// 创建pinia实例 +const pinia = createPinia() + +// 数据持久化 +pinia.use(Persistedstate); +// 注册pinina +app.use(pinia) app.use(router) app.mount('#app') diff --git a/src/router/index.ts b/src/router/index.ts index a49ae50..f82f8d5 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,22 +1,17 @@ import { createRouter, createWebHistory } from 'vue-router' -import HomeView from '../views/HomeView.vue' + const router = createRouter({ + + // 路由模式 history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', - name: 'home', - component: HomeView + name: 'index', + component: () => import('../views/index.vue') }, - { - path: '/about', - name: 'about', - // route level code-splitting - // this generates a separate chunk (About.[hash].js) for this route - // which is lazy-loaded when the route is visited. - component: () => import('../views/AboutView.vue') - } + ] }) diff --git a/src/stores/counter.ts b/src/stores/counter.ts deleted file mode 100644 index b6757ba..0000000 --- a/src/stores/counter.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' - -export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) - function increment() { - count.value++ - } - - return { count, doubleCount, increment } -}) diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue deleted file mode 100644 index 756ad2a..0000000 --- a/src/views/AboutView.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue deleted file mode 100644 index d5c0217..0000000 --- a/src/views/HomeView.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..d4a6f9e --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,8 @@ + + + + \ No newline at end of file -- Gitee From db7840f82a0846bed2ac3a34cff2c1163046ba0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=95=BF=E7=A9=BA?= <10753139+fang-zifu@user.noreply.gitee.com> Date: Fri, 23 Feb 2024 16:35:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96npm=20run=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ src/App.vue | 5 +---- src/main.ts | 2 +- src/router/index.ts | 7 ++----- src/views/index.vue | 6 ++---- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index baf470e..28c0c38 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ npm install npm run dev ``` + +```sh +npm run format +``` ### Type-Check, Compile and Minify for Production ```sh diff --git a/src/App.vue b/src/App.vue index f021b88..39f5614 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,4 @@ - - + diff --git a/src/main.ts b/src/main.ts index f670b2b..5d16483 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,7 @@ const app = createApp(App) const pinia = createPinia() // 数据持久化 -pinia.use(Persistedstate); +pinia.use(Persistedstate) // 注册pinina app.use(pinia) app.use(router) diff --git a/src/router/index.ts b/src/router/index.ts index f82f8d5..af5f602 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,17 +1,14 @@ import { createRouter, createWebHistory } from 'vue-router' - const router = createRouter({ - // 路由模式 history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: '/', name: 'index', - component: () => import('../views/index.vue') - }, - + component: () => import('@/views/index.vue') + } ] }) diff --git a/src/views/index.vue b/src/views/index.vue index d4a6f9e..33cc3d2 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,8 +1,6 @@ - \ No newline at end of file + -- Gitee From 5720d841c5805847f000b86da5ef814a632fc916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=95=BF=E7=A9=BA?= <10753139+fang-zifu@user.noreply.gitee.com> Date: Fri, 23 Feb 2024 18:11:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=90=AD=E5=BB=BA=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 39 ++++++++++++++++++++++++++++++++++- src/views/film.vue | 4 ++++ src/views/index.vue | 1 + src/views/index/active.vue | 4 ++++ src/views/index/center.vue | 4 ++++ src/views/index/cinemas.vue | 4 ++++ src/views/index/films.vue | 4 ++++ src/views/login.vue | 6 ++++++ src/views/user_oder.vue | 4 ++++ src/views/user_red_packet.vue | 4 ++++ 10 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/views/film.vue create mode 100644 src/views/index/active.vue create mode 100644 src/views/index/center.vue create mode 100644 src/views/index/cinemas.vue create mode 100644 src/views/index/films.vue create mode 100644 src/views/login.vue create mode 100644 src/views/user_oder.vue create mode 100644 src/views/user_red_packet.vue diff --git a/src/router/index.ts b/src/router/index.ts index af5f602..1c3e777 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -7,7 +7,44 @@ const router = createRouter({ { path: '/', name: 'index', - component: () => import('@/views/index.vue') + component: () => import('@/views/index.vue'), + children: [ + { + path: 'films', + name: 'films', + component: () => import('@/views/index/films.vue') + }, + { + path: 'active', + name: 'active', + component: () => import('@/views/index/active.vue') + }, + { + path: 'cinemas', + name: 'cinemas', + component: () => import('@/views/index/cinemas.vue') + } + ] + }, + { + path: '/login', + name: 'login', + component: () => import('@/views/login.vue') + }, + { + path: '/user_oder', + name: 'user_oder', + component: () => import('@/views/user_oder.vue') + }, + { + path: '/film/:id', + name: 'film', + component: () => import('@/views/film.vue') + }, + { + path: '/user_red_packet', + name: 'user_red_packet', + component: () => import('@/views/user_red_packet.vue') } ] }) diff --git a/src/views/film.vue b/src/views/film.vue new file mode 100644 index 0000000..f4230b2 --- /dev/null +++ b/src/views/film.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index 33cc3d2..232c5cc 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/index/active.vue b/src/views/index/active.vue new file mode 100644 index 0000000..8c7fe98 --- /dev/null +++ b/src/views/index/active.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/index/center.vue b/src/views/index/center.vue new file mode 100644 index 0000000..a7f0ce9 --- /dev/null +++ b/src/views/index/center.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/index/cinemas.vue b/src/views/index/cinemas.vue new file mode 100644 index 0000000..5a3efaa --- /dev/null +++ b/src/views/index/cinemas.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/index/films.vue b/src/views/index/films.vue new file mode 100644 index 0000000..e3583c3 --- /dev/null +++ b/src/views/index/films.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/login.vue b/src/views/login.vue new file mode 100644 index 0000000..1139e75 --- /dev/null +++ b/src/views/login.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/src/views/user_oder.vue b/src/views/user_oder.vue new file mode 100644 index 0000000..199abe8 --- /dev/null +++ b/src/views/user_oder.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/src/views/user_red_packet.vue b/src/views/user_red_packet.vue new file mode 100644 index 0000000..3c07a45 --- /dev/null +++ b/src/views/user_red_packet.vue @@ -0,0 +1,4 @@ + + \ No newline at end of file -- Gitee From 8d2d2cf2b659d5de2870a5b3bdd3c918c804f4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=95=BF=E7=A9=BA?= <10753139+fang-zifu@user.noreply.gitee.com> Date: Fri, 23 Feb 2024 20:03:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=A1=86=E6=9E=B6=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 11 +++++++++++ package.json | 1 + src/App.vue | 4 ++++ src/global.css | 4 ++++ src/views/index.vue | 42 ++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/global.css diff --git a/package-lock.json b/package-lock.json index c193983..045a7c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "maizuo", "version": "0.0.0", "dependencies": { + "normalize.css": "^8.0.1", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.4.15", @@ -2194,6 +2195,11 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/normalize.css": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/normalize.css/-/normalize.css-8.0.1.tgz", + "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==" + }, "node_modules/npm-normalize-package-bin": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", @@ -4485,6 +4491,11 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "normalize.css": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/normalize.css/-/normalize.css-8.0.1.tgz", + "integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg==" + }, "npm-normalize-package-bin": { "version": "3.0.1", "resolved": "https://registry.npmmirror.com/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", diff --git a/package.json b/package.json index fed7092..a1d5b41 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "format": "prettier --write src/" }, "dependencies": { + "normalize.css": "^8.0.1", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "vue": "^3.4.15", diff --git a/src/App.vue b/src/App.vue index 39f5614..783d077 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,3 +3,7 @@ + \ No newline at end of file diff --git a/src/global.css b/src/global.css new file mode 100644 index 0000000..14c6ff1 --- /dev/null +++ b/src/global.css @@ -0,0 +1,4 @@ +@import 'normalize.css'; + html, body, #app { + height: 100%; + } \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index 232c5cc..8407abb 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,7 +1,45 @@ + \ No newline at end of file -- Gitee