Client - install vue-i18n

This commit is contained in:
Sam
2021-08-04 09:26:49 +02:00
parent d795d9bf38
commit 04f64b750c
8 changed files with 306 additions and 16 deletions

View File

@ -0,0 +1,30 @@
<template>
<p>{{ t('hello') }}</p>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { useI18n } from 'vue-i18n'
export default defineComponent({
name: 'HelloI18n',
setup() {
const { t } = useI18n({
inheritLocale: true,
useScope: 'local',
})
// Something todo ..
return { t }
},
})
</script>
<i18n>
{
"en": {
"hello": "Hello i18n in SFC!"
}
}
</i18n>