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