参数:

    • :必填,关于语言环境信息的键名路径
    • locale {Locale}:可选,语言环境
    • tag {string}:可选,默认值 span
    • places {Array | Object}:可选 (7.2 新增)

    用法:

    1. const messages = {
    2. tos: 'Term of Service',
    3. },
    4. ja: {
    5. tos: '利用規約',
    6. term: '私は xxx の{0}に同意します。'
    7. }
    8. }
    9. locale: 'en',
    10. messages
    11. })
    12. new Vue({
    13. i18n,
    14. data: {
    15. url: '/term'
    16. }).$mount('#app')

    请参阅:

    组件插值