Skip to content
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

Typescript support #39

Open
true-eye opened this issue Sep 17, 2020 · 2 comments
Open

Typescript support #39

true-eye opened this issue Sep 17, 2020 · 2 comments

Comments

@true-eye
Copy link

Great Library!

I'm using vue.js and typescript. Is there any typescript version for this library?

Please let me know
Thanks,

@lowbits
Copy link

lowbits commented Apr 13, 2021

push

@Tryops
Copy link

Tryops commented Oct 30, 2021

You can add the line

declare module 'vue-text-highlight';

to your src/shims-vue.d.ts file (or any other src/*.d.ts file in src).
Then the component can be used with Vue + Typescript when registered globally (e.g. in main.ts) like this:

import TextHighlight from 'vue-text-highlight'; // import works now
Vue.component('text-highlight', TextHighlight);

That worked for me at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants