-
Notifications
You must be signed in to change notification settings - Fork 405
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
Can't find module "vue-good-table" Typescript #280
Comments
You can add a custom type definition for vue-good-table or wait for someone to contribute one 😅 |
Problem is actual. I tried to add this:
my-component.ts
Compiler has no errors, but runtime has error:
Can someone give more specific advice with short example, how to import vue-good-table component correctly using typescript? |
@Dried09 @AhmedElbatt component export should now be fixed with v2.8.1 Install instruction for your ref: |
@xaksis Do you have a solution? |
@rafaelgov95 umm... yeah... v2.8.1 should have a fix to the problem stated here... |
I figured out this problem, but... it's actually not a good solution
Then in some component add import: After that table component should work. |
@Dried09 with 2.8.1 you should be able to do what you were doing before: shims.d.ts
my-component.ts
can you confirm that this doesn't work for you? |
Nope, still not :( |
I don't use typescript so someone else can help you better here but it seems like you need to export it from your shim too like: declare module "*.vue" {
import Vue from "vue";
export default Vue;
} so following that logic, your shim might need to be: declare module 'vue-good-table' {
import { VueGoodTable } from 'vue-good-table';
export default VueGoodTable;
} make sure you're on 2.8.1 because 2.8.1 exports VueGoodTable versions before don't. |
Without claiming to understand much of all this, I did get it working by creating a folder
Make sure typescript is set to include that file. My
Now, in my view component, I can write
and
and compilling it doesn't complain and works. |
I am newbie to either typescript and Vue.js ; and I am experiencing an issue that related with using the Vue-good-table componant inside a typescript file like this;
import VueGoodTable from 'vue-good-table';
import 'vue-good-table/dist/vue-good-table.css'
TS compiler throws a compile error (Can't find module "vue-good-table").Can anyone help me please ?
The text was updated successfully, but these errors were encountered: