-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add copy button for code #106
Conversation
Deploy preview for code-generator ready! Built with commit a5e0951 |
src/components/CodeBlock.vue
Outdated
setTimeout(() => (copyText.value = 'Copy'), 3000) | ||
// alert('Code has been copied to clipboard.') |
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.
@vfdev-5 How do we want to show Code is being copied?
Currently, it changes "Copy" to "Copied" once clicked and revert back to "Copy" after 3 seconds. OR do you want to give an alert that code has been copied?
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.
Tried "alert mode" locally and it's annoying when we click "Copy" again and again.
* feat: add copy button for code * chore: format * refactor: use string template instead of template ref * chore: remove alert code * fix: try and catch error when copying code
Description
Part of #103
Add copy button for
CodeBlock
to copy the codeAdditional context
What is the purpose of this pull request?