Skip to content

Commit

Permalink
fix: update router plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
elonehoo committed Aug 18, 2024
1 parent 84530f4 commit 823e0d6
Show file tree
Hide file tree
Showing 7 changed files with 696 additions and 92 deletions.
6 changes: 3 additions & 3 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
readonly VITE_APP_TITLE: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
readonly env: ImportMetaEnv
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"vite-plugin-classify": "^0.0.1",
"vite-plugin-package-configs": "^0.0.12",
"vite-plugin-terminal-log": "^0.0.1",
"vite-plugin-vue-devtools": "^7.3.8",
"vitest": "^1.3.1",
"vue-tsc": "^2.0.14"
}
Expand Down
765 changes: 680 additions & 85 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/pages/hi/[name].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<script setup lang="ts">
defineProps<{ name: string }>()
const router = useRouter()
const route = useRoute()
const name = computed(() => {
return route.params.name
})
</script>

<template>
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"types": [
"vite/client",
"vitest/globals"
"vitest/globals",
"unplugin-vue-router/client"
],
"resolveJsonModule": true,
"esModuleInterop": true,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"vite.config.ts",
"auto-imports.d.ts",
"components.d.ts",
"typed-router.d.ts"
"./typed-router.d.ts"
]
}
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import Classify from 'vite-plugin-classify'
import TerminalLog from 'vite-plugin-terminal-log'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import { unheadVueComposablesImports } from '@unhead/vue'
import DevTools from 'vite-plugin-vue-devtools'

export default defineConfig({
plugins: [
// https://github.com/vuejs/devtools-next
DevTools(),
// https://github.com/vite-inspector/vite-inspector
Inspector({
framework: 'vue',
Expand Down

0 comments on commit 823e0d6

Please sign in to comment.