Open yangwao opened 4 years ago
Hey @yangwao ! Thank you first, however, I haven't had the time to learn TypeScript. So actually I'm quite confused, how I can add a declaration file! I looked up in StackOverflow, but it's quite confusing 🙈Any tips for me?
I have this exact problem. Any tips how to solve this :)?
@MarcusMLarsson I really don't know since I don't find the time to learn typescript. But perhaps this post helps you: https://stackoverflow.com/questions/47848778/parameter-implicitly-has-an-any-type/47848779
If anyone have solved this issue please share here. Thanks
If anyone have solved this issue please share here. Thanks
Hi, guys. How are you doing?
So. I'm not sure if I did it in the right way but I was able to make normal usage by doing the following:
import VideoBackground from "vue-responsive-video-background-player";
declare module "vue-responsive-video-background-player"
and voilá. Works like a charm.
I'm using Vue 3 with Vite.
Really hope this works and helps someone!
create the .d.ts file in src/
Import in my component and use it as doc says
Declare the module and name it
Ta-da!
PS - The only thing that was not working for me is use TypeScript Path Alias.
So instead of
src="@/assets/video/bg-video.mp4"
it only works with
src="/src/assets/videos/bg-video.mp4"
Hope helps someone!
Hi, guys. How are you doing?
So. I'm not sure if I did it in the right way but I was able to make normal usage by doing the following:
- Installed package as documentation says. (I'm using yarn for this project)
- imported as a component
import VideoBackground from "vue-responsive-video-background-player";
- created a .d.ts file (inside src/) named 'responsive-video-background.d.ts' with only one line of code in it
declare module "vue-responsive-video-background-player"
and voilá. Works like a charm.
I'm using Vue 3 with Vite.
Really hope this works and helps someone!
Yes! Your solution above absolutely works. Thanks for sharing!!!!!!
Great work but would be doable to have types :)