Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

xe-clipboard

1.0.1 • Public • Published

xe-clipboard

npm version npm build npm downloads npm license

It depends on the execCommand APIs, support commonly used H5 browser IE, Chrome, Firefox, Opera, Safari, IOS, Android, compressed less than 1KB clipboard copy function.

Browser Support

IE Edge Chrome Firefox Opera Safari
10+ ✔ Latest ✔ 42+ ✔ 41+ ✔ 29+ ✔ 10+ ✔

Installing

npm install xe-clipboard --save
 
import XEClipboard from 'xe-clipboard'
<script src="https://cdn.jsdelivr.net/npm/xe-clipboard/dist/xe-clipboard.js"></script>
 
<script src="https://unpkg.com/xe-clipboard/dist/xe-clipboard.js"></script>

Example

document.querySelector('.button').addEventListener('click', evnt => {
  if (XEClipboard.copy('Copy this content to the clipboard.')) {
    alery('Copy success.')
  } else {
    alert('The browser is not supported.')
  }
})

License

Copyright (c) 2017-present, Xu Liangzhan

install

npm i xe-clipboard

Downloadsweekly downloads

11

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability