npm.io
1.0.2 • Published 4 years ago

easycopyjs

Licence
ISC
Version
1.0.2
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
2

EasyCopy

Copy text based on clipboard.js 2.0.11

version npmDownloadTotal githubIssues

Install

npm install --save easycopyjs

Usage

<div id="app"></div>

<template>
    <section>
        <button @click="doCopy">do Copy</button>
    </section>
</template>

<script>
import { copyText } from 'easycopyjs'
export default {
    methods: {
        async doCopy() {
            try {
                const copyEvent = await copyText('something')
                console.log('copy success', copyEvent)
            } catch (e) {
                console.log('copy fail', e)
            }
        },
    },
}
</script>

end

If you feel helpful, you can come to Github give me a star, your is the biggest encouragement to me ~

Keywords