-
Notifications
You must be signed in to change notification settings - Fork 68
feat: add useScriptVimeo + Vimeo component #8
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
Conversation
This is looking great! Thanks for your work. I'd like to see this get merged, did you have anything else on your end you wanted to do? |
src/runtime/components/Vimeo.vue
Outdated
const id = useId(); | ||
const status: Ref<string> = ref(null); | ||
|
||
const { Player } = useScriptVimeo(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cool to see the script load in lazily based on whether the component is entering the viewport.
This can be done with the trigger option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, should I add lazy
prop to the component which is true
by default?
No problem 🙂 I'll need to fix those minor issues because it's still work in progress, I just wanted to check if you agree with having "wrapper" components for some scripts. |
|
||
let player; | ||
|
||
if (!props.lazy) $script.then(init); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really cool 👏 good call on the prop
maybe we could add a prop for the rootMargin
with a default of ~50px, it should help minimise the CLS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 sure, I'll add that
Thanks again for your work on this, it's a great addition. I'm going to merge it in, it may need some slight tweaks once I play around with it. Will also need docs but I need to figure out how those are going to work. |
WIP - showcase for Vimeo component