Ruh*_*ara 10 javascript vue.js vuetify.js
我创建了一个新的 vue 项目,然后我添加了 vuetify,
$ vue create my-app
$ cd my-app
$ vue add vuetify
$ npm run serve
Run Code Online (Sandbox Code Playgroud)
然后我得到了这个错误
ERROR in /home/ruhith/Documents/vue/file upload/fileupload/src/plugins/vuetify.ts(2,21):
2:21 Could not find a declaration file for module 'vuetify/lib'. '/home/ruhith/Documents/vue/file upload/fileupload/node_modules/vuetify/lib/index.js' implicitly has an 'any' type.
Try `npm install @types/vuetify` if it exists or add a new declaration (.d.ts) file containing `declare module 'vuetify/lib';`
1 | import Vue from 'vue';
> 2 | import Vuetify from 'vuetify/lib';
| ^
3 |
4 | Vue.use(Vuetify);
5 |
Version: typescript 3.8.3
Time: 2774ms
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?这是 vuetufy 中的错误吗?
您需要将 vuetify 的类型添加到 tsconfig.json 中,如下所示:
// tsconfig.json
{
"compilerOptions": {
"types": ["vuetify"]
}
}
Run Code Online (Sandbox Code Playgroud)
取自这里的常见问题解答:https : //vuetifyjs.com/en/getting-started/frequently-asked-questions/#questions
小智 -4
更改文件node_modules->vuetify-loader->lib->plugin.js
class VuetifyLoaderPlugin {
constructor (options) {
// this.options = options || {}
this.options = (options) ? options : {}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2665 次 |
| 最近记录: |