项目作者: trlanfeng

项目描述 :
基于Nuxt的多国语言demo
高级语言: JavaScript
项目地址: git://github.com/trlanfeng/nuxt-i18n-demo.git
创建时间: 2019-04-26T05:21:04Z
项目社区:https://github.com/trlanfeng/nuxt-i18n-demo

开源协议:

下载


nuxt-i18n-demo

基于 Nuxt + Vue-i18n 实现多国语言

主要为 nuxt.config.js 中对路由进行扩展,复制一份所有自动生成的多语言路由,之后插入到路由数组起始位置。来实现不需要默认页面,并能够不带语言标记浏览默认语言页面。

如:

localhost 显示 localhost/zh 页面内容,而不进行跳转

localhost/page 显示 localhost/zh/page

Build Setup

  1. # install dependencies
  2. $ npm install
  3. # serve with hot reload at localhost:3000
  4. $ npm run dev
  5. # build for production and launch server
  6. $ npm run build
  7. $ npm start
  8. # generate static project
  9. $ npm run generate

For detailed explanation on how things work, checkout Nuxt.js docs.