我想在typescript中使用vuetify插件。 在文档(https://vuetifyjs.com/vuetify/quick-start)中,它表示使用Vue.use(),但在typescript中有这样的错误:
"error TS2345: Argument of type '{}' is not assignable to parameter of type 'undefined'."
Vue.use(Vuetify, {
theme: {
primary: '#3f51b5',
secondary: '#b0bec5',
accent: '#8c9eff',
error: '#b71c1c'
}
})
答案 0 :(得分:0)
在tsconfig.json中添加" compilerOptions"部分:
"module": "es2015"
答案 1 :(得分:0)
对于正在寻找该问题解决方案的任何人:使用VueJs + Typescript时,您想要使用Vuetify或VeeValidate之类的插件。
例如VeeValidate请执行以下操作:
import Vue from "vue";
import VeeValidate from "vee-validate";
Vue.use(VeeValidate.install, { });