1.10.2 • Published 3 years ago
xe-clipboard v1.10.2
xe-clipboard
基于 execCommand API 实现复制内容到剪贴板,支持主流的 H5 浏览器 IE, Chrome, Firefox, Opera, Safari, IOS, Android
压缩大小 < 0.5KB
Browser Support
10+ ✔ | Latest ✔ | 42+ ✔ | 41+ ✔ | 29+ ✔ | 10+ ✔ |
Installing
npm install xe-clipboard
<script src="https://cdn.jsdelivr.net/npm/xe-clipboard"></script>
Example
<button id="btn1">Copy</button>
document.getElementById('btn1').addEventListener('click', function (evnt) {
// 由于浏览器的安全机制,操作剪贴板必须在事件之内才能有效
if (XEClipboard.copy('Copy this content to the clipboard.')) {
alert('Copy success.')
} else {
alert('The browser is not supported.')
}
})
License
MIT © 2017-present, Xu Liangzhan
1.10.2
3 years ago
1.10.1
3 years ago
1.10.0
4 years ago
1.9.0
4 years ago
1.8.0
4 years ago
1.7.2
5 years ago
1.7.1
5 years ago
1.7.0
5 years ago
1.6.0
5 years ago
1.5.0
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.0
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago