fix: dynamic route parameters (#515)
This commit is contained in:
1 parent
ccad06d9dd
commit
009a05dea9
1 file changed
+3
-3
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
const props = defineProps<{ name: string }>()
|
||||
const router = useRouter()
|
||||
const route = useRoute('/hi/[name]')
|
||||
const user = useUserStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
watchEffect(() => {
|
||||
user.setNewName(props.name)
|
||||
user.setNewName(route.params.name)
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,7 @@ watchEffect(() => {
|
||||
<div i-carbon-pedestrian inline-block />
|
||||
</div>
|
||||
<p>
|
||||
{{ t('intro.hi', { name: props.name }) }}
|
||||
{{ t('intro.hi', { name: user.savedName }) }}
|
||||
</p>
|
||||
|
||||
<p text-sm opacity-75>
|
||||
|
||||
Reference in new issue
Block a user