Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import vuetify/lib while using vuetify loader in A-La-Carte system

While using A-La-Carte system in vuetify with vuetify-loader I got a typescript error while importing vuetify/lib, I am unable to understand what I am doing wrong here. Need some help to import this.

I was following this documentation

import Vue from 'vue'
import Vuetify from 'vuetify/lib' // Error line
import 'vuetify/src/stylus/app.styl'

Vue.use(Vuetify)

Could not find a declaration file for module 'vuetify/lib'. '/Users/.../vuetify/lib/index.js' implicitly has an 'any' type.

I have tried replacing it with below line but it didn't work as well.

const Vuetify = require('vuetify/lib');
like image 460
ZaidRehman Avatar asked Dec 03 '18 06:12

ZaidRehman


1 Answers

Add vuetify in compilerOptions > types of your tsconfig.json

It should look like this:

{
 compilerOptions: {
    //other options here
    "types": ["vuetify"],
 }
}

Save and reload your vscode.

like image 159
pranavjindal999 Avatar answered Oct 04 '22 01:10

pranavjindal999