Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引入使用后把国际化数据给替换了。。。。 #111

Open
moshuiqing opened this issue Dec 16, 2022 · 3 comments
Open

引入使用后把国际化数据给替换了。。。。 #111

moshuiqing opened this issue Dec 16, 2022 · 3 comments

Comments

@moshuiqing
Copy link

No description provided.

@madmax970217
Copy link

解决方法:项目中使用到国际化的地方,$t 改为 $tc ,其他文件无需改动。

@AkaneMurakawa
Copy link

AkaneMurakawa commented Mar 22, 2023

解决方法:项目中使用到国际化的地方,$t 改为 $tc ,其他文件无需改动。

这虽然可以解决,但还是习惯用$t,其实Vue I18n本身就支持添加额外的数据,不懂为什么还再重写插件。如果想重写,我觉得完全可以不要绑定在Vue.prototype.$t上,会带来很多麻烦

  install (Vue) {
    Vue.prototype.$t = function (expression) {
      return i18n.t(expression)
    }
  }
}

@deltacat
Copy link

deltacat commented Sep 5, 2023

作为一个组件,引用更基础的组件时强制改写组件的接口,令人费解。

我们试用一个admin框架,该框架采用 $t 进行格式化,近期第三方更新时引入了该video组件,忽然国际化就用不了了,花了小半天时间,甚至对node_modules内容进行了全文搜索,才定位到这里。

这是需要被修复的BUG。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants