安装modernwms时出现'$t' does not exist on type '解决方法

 

打开项目 src/env.d.ts(没有就新建 src/vue-i18n.d.ts),写入下面代码:

declare module 'vue' {
  interface ComponentCustomProperties {
    $t: (key: string, ...args: any[]) => string
  }
}
export {}

export {} 必须写,否则模块扩展不生效Vue.js

posted on 2026-09-19 13:29  dingyun  阅读(7)  评论(0)    收藏  举报

导航