-
vue.3(v-i18n)JS/vue.js 2022. 3. 10. 15:01
i18n : 국제화(다국어) 지원해주는 오픈 소스(It easily integrates some localization features to your Vue.js Application.)
→json { 내용 : 해당 언어로 쓰인 내용 } 형식
→언어별로 (ko.json, en.json) 파일 작성
//en.json const messages = { en: { message: { hello: '{msg} world' } } }
//app.vue <p>{{ $t('message.hello', { msg: 'hello' }) }}</p> //위치 //입력값
<p>hello world</p>
//main.js new Vue({ store, router, i18n, render: h => h(App) }).$mount('#app')
main.js : i18n 1.import 2.사용하는거 알려주기
참고 :
https://kazupon.github.io/vue-i18n/
Vue I18n
kazupon.github.io
'JS > vue.js' 카테고리의 다른 글
에러1(ERESOLVE unable to resolve dependency tree에러) (0) 2022.03.11 vue4(router childeren-라우터 중첩) (0) 2022.03.10 vue.2(mixin) (0) 2022.03.10 vue1(ref/디렉티브) (0) 2022.03.08 vue0.(vue/라이프사이클) (0) 2022.02.21