fix: route params (#44)

This commit is contained in:
chenxueli authored and GitHub committed 2023-12-05 11:08:42 +01:00
1 parent 1da18b38a8
commit 75eb3da88a
1 file changed
+2 -2
+2 -2
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>