Created
August 26, 2019 07:57
-
-
Save sin-tanaka/32c1ae1474207bcf722da506d1f1648a 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
<template> | |
<div> | |
<input id="copy-text" value="copy text" /> | |
</div> | |
</template> | |
<script> | |
export default { | |
methods: { | |
copyToClipboard: function() { | |
const target = document.querySelector('#copy-text'); | |
target.select(); | |
const result = document.execCommand('copy'); | |
console.log('copy clipboard', result); | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment