Skip to content

Conversation

@ShangChien
Copy link
Contributor

@ShangChien ShangChien commented Nov 28, 2024

Description:

Fixed an error in the usage of the Blob constructor when creating a ClipboardItem.
The original code nested { type: mime } in Array, which resulted in improperly generated Blob content.

Change:

modify

new ClipboardItem({
    [mime]: new Blob(['\'<b>HTML content</b>\'', { type: mime }]),
})

to

new ClipboardItem({
    [mime]: new Blob([`<b>HTML content</b>`], { type: mime }),
})

…when creating a ClipboardItem. The original code used an incorrect string format, which resulted in improperly generated Blob content.
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. documentation Improvements or additions to documentation labels Nov 28, 2024
@ShangChien ShangChien changed the title docs typo error: Fixed an error in the usage of the Blob constructor when creating a ClipboardItem. The original code used an incorrect string format, which resulted in improperly generated Blob content. docs typo error (useClipboardItems) Nov 28, 2024
@naokihaba naokihaba self-assigned this Dec 19, 2024
@naokihaba naokihaba self-requested a review December 19, 2024 14:06
ShangChien and others added 2 commits December 19, 2024 22:14
Replace backticks with single quotes

Co-authored-by: Naoki Haba <59875779+NaokiHaba@users.noreply.github.com>
@naokihaba naokihaba self-requested a review December 19, 2024 14:22
@naokihaba naokihaba self-requested a review December 19, 2024 14:23
Copy link
Collaborator

@naokihaba naokihaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your support!

@naokihaba naokihaba requested review from antfu and removed request for antfu December 19, 2024 14:24
@antfu antfu changed the title docs typo error (useClipboardItems) docs(useClipboardItems): fix example Dec 20, 2024
@antfu antfu merged commit d19606b into vueuse:main Dec 20, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants