Skip to content

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

Merged
merged 6 commits into from
Apr 11, 2024

Conversation

darioferderber
Copy link
Contributor

WIP - showcase for Vimeo component

@harlan-zw
Copy link
Collaborator

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?

const id = useId();
const status: Ref<string> = ref(null);

const { Player } = useScriptVimeo();
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

@darioferderber
Copy link
Contributor Author

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?

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);
Copy link
Collaborator

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

Copy link
Contributor Author

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

@harlan-zw
Copy link
Collaborator

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.

@harlan-zw harlan-zw merged commit 7626cea into nuxt:main Apr 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants