Giter VIP home page Giter VIP logo

Comments (3)

grapewheel avatar grapewheel commented on July 28, 2024

根据官方文档提及,理论上也是和其他vant组件一样import使用即可,page.ejs是webpack生成页面模板,脚手架并没有对他做es6转义,所以不能用import等es6语法,推荐在每个需要国际化的vue页面中import,例如:

<script>
  import { Locale } from 'vant';
  import enUS from 'vant/lib/locale/lang/en-US';

  Locale.use('en-US', enUS);
</script>

如果不希望这么麻烦每个页面添加,可以考虑使用vue的mixins特性,其实国际化有很多实现方式,简单的实现方式是配置多个语言json文件,然后根据客户端语言版本装载对应json显示也行

from avvw.

kin-chen avatar kin-chen commented on July 28, 2024

我试着尝试一下,感谢提供帮助。今天看到了支持热重载,那真是太棒了,越来越好。

from avvw.

grapewheel avatar grapewheel commented on July 28, 2024

好的,感谢支持!

from avvw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.