• 安裝 vue-i18n

繼  在 Node JS 使用 vue-cli 3 快速開發網頁與佈署到 github-pages 後,接下來要實作 i18n 多國語系網站,npm 安裝的方式,指令是 npm install vue-i18n ,在 Vue i18n 官方文件中有提供 Vue-cli 3 專用的 vue add i18n指令

PS nodejs\vue2-apps> vue add i18n
 
� Installing vue-cli-plugin-i18n...
 
+ vue-cli-plugin-i18n@1.0.1
added 17 packages from 15 contributors and audited 1631 packages in 80.325s
 
55 packages are looking for funding
run `npm fund` for details
 
✔ Successfully installed plugin: vue-cli-plugin-i18n
 
? The locale of project localization. en
? The fallback locale of project localization. en
? The directory where store localization messages of project. It's stored under `src` directory. locales
? Enable locale messages in Single file components ? No

安裝完後,由下圖可以知道 vue add i18n指令幫我們作了很多事,實在太方便了

vue-i18n

 

繼續閱讀

arrow
arrow
    文章標籤
    vue-cli i18n
    全站熱搜

    MIS 發表在 痞客邦 留言(0) 人氣()