From 87cf34de827abf436f8120f6b1b98091296ce15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Wed, 14 Aug 2024 10:17:49 +0800 Subject: [PATCH] chore: Update main.css and main.ts, add data-loaders.[id].vue and update index-page.vue --- src/assets/main.css | 2 + src/main.ts | 9 ++++- src/pages/data-loaders.[id].vue | 69 +++++++++++++++++++++++++++++++++ src/pages/index-page.vue | 3 +- typed-router.d.ts | 1 + 5 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 src/pages/data-loaders.[id].vue diff --git a/src/assets/main.css b/src/assets/main.css index 40a5eeb..5fa28a4 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -7,6 +7,7 @@ font-weight: normal; } +button, a, .green { text-decoration: none; @@ -16,6 +17,7 @@ a, } @media (hover: hover) { + button:hover, a:hover { background-color: hsla(160, 100%, 37%, 0.2); } diff --git a/src/main.ts b/src/main.ts index 60bb65d..246c790 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,5 +6,12 @@ import { createPinia } from 'pinia'; import App from './App.vue'; import { router } from './router'; +import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders'; -createApp(App).use(createPinia()).use(router).mount('#app'); +createApp(App) + .use(createPinia()) + // Register the plugin before the router + .use(DataLoaderPlugin, { router }) + // adding the router will trigger the initial navigation + .use(router) + .mount('#app'); diff --git a/src/pages/data-loaders.[id].vue b/src/pages/data-loaders.[id].vue new file mode 100644 index 0000000..8464228 --- /dev/null +++ b/src/pages/data-loaders.[id].vue @@ -0,0 +1,69 @@ + + + + + diff --git a/src/pages/index-page.vue b/src/pages/index-page.vue index 1cf2651..d516d90 100644 --- a/src/pages/index-page.vue +++ b/src/pages/index-page.vue @@ -1,6 +1,4 @@