Skip to content

Commit

Permalink
fix: dynamic route parameters (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeojongki authored Nov 13, 2023
1 parent ccad06d commit 009a05d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/hi/[name].vue
Original file line number Diff line number Diff line change
@@ -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>

Expand All @@ -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>
Expand Down

0 comments on commit 009a05d

Please sign in to comment.