下载
npm i use-light-copy --save
使用
支持Promise
.then 返回Boolean true为复制成功
/*
* @name: toCopy
* @test: test font
* @msg:
* @param text:String options:Object =>{debug:Boolean}
* @return Promise=>then(res:Boolean)
*/
const { toCopy } = require('use-light-copy')
// 模拟点击事件
button.addEventListener('click', async () => {
await isCopy = toCopy('This is some cool text',{debug:true})
})