fix: route params (#44)

This commit is contained in:
chenxueli 2023-12-05 18:08:42 +08:00 committed by GitHub
parent 1da18b38a8
commit 75eb3da88a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
const props = defineProps<{ name: string }>()
const params = useRoute('/hi/[name]').params
const router = useRouter()
</script>
@ -7,7 +7,7 @@ const router = useRouter()
<div>
<div i-carbon-pedestrian inline-block text-4xl />
<p>
Hi, {{ props.name }}
Hi, {{ params.name }}
</p>
<p text-sm op50>
<em>Dynamic route!</em>