多語系 Vue I18n - daniel-qa/Vue GitHub Wiki
- 多語系使用方式
..\ClientApp\src\language\lang\zh-tw.js
- template 使用多語系
{{$t(`home.dataTime`)}}
- 後端使用多語系
Composition API 嗎?(script setup)
在 script setup 中,這樣寫才對:
<script setup>
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
</script>
<template>
<div>{{ t('systemConfig.pushmsg.pushMsg') }}</div>
</template>
在 Script 中使用,使用方式與 template 中使用方式一樣
t('systemConfig.pushmsg.pushMsg')