前端常用的函数集合。
npm install kfunc --save
在模块中调用(以拷贝文字函数举例)
import Kfunc from 'kfunc'
let success = Kfunc.copyText('hello')
按需引入
import copyText from 'kfunc/copyText'
let success = copyText('hello')
<script src="kfunc.js"></script>
<script>
let success = Kfunc.copyText('hello')
console.log(success)
</script>
- <string> 传入要复制的字符串
- <bool> 成功或失败的布尔值