-
-
Save fadamakis/66b4c2d55b8b687e2bffb2f23065b2e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useClipboard } from '@vueuse/core' | |
const source = ref('Hello') | |
const { text, copy, copied, isSupported } = useClipboard({ source }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button @click='copy()'> | |
<!-- by default, `copied` will be reset in 1.5s --> | |
<span v-if='!copied'>Copy</span> | |
<span v-else>Copied!</span> | |
</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment