{"_id":"vue3-clipboard","_rev":"1-1571e3d4b1df6d8e70d0783b7c9814f8","name":"vue3-clipboard","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"vue3-clipboard","version":"1.0.0","description":"A Vuejs3 binding for clipboard.js","main":"dist/vue3-clipboard.js","module":"dist/vue3-clipboard-es.js","scripts":{"build":"rollup -c build/rollup.config.dev.js","build:prod":"rollup -c build/rollup.config.prod.js","clean":"rimraf dist"},"repository":{"type":"git","url":"git+https://github.com/Daizhen1995/vue3-clipboard.git"},"keywords":["vue","vue3","clipboard","clipboard.js"],"author":{"name":"daizhen1995","email":"daizhen@know-act.com"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.3","@babel/preset-env":"^7.12.1","eslint":"^7.13.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.2","rimraf":"^3.0.2","rollup":"^2.33.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-terser":"^7.0.2"},"peerDependencies":{"vue":"^3.0.0"},"dependencies":{"clipboard":"^2.0.6"},"gitHead":"4879e2a15e0e7c32b9cdf17723293b75aa052669","bugs":{"url":"https://github.com/Daizhen1995/vue3-clipboard/issues"},"homepage":"https://github.com/Daizhen1995/vue3-clipboard#readme","_id":"vue3-clipboard@1.0.0","_nodeVersion":"12.17.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GUqKh1oO79xDpq0z+cCv/NDVTpcJGNDzeNgT3PmTdTp/WJh3gcTrDqIYKycKhzMFOtIFJ7hO/+usgyWtT+fNhA==","shasum":"f7d17a00bce6579ba866df825541563b272610f2","tarball":"https://registry.npmjs.org/vue3-clipboard/-/vue3-clipboard-1.0.0.tgz","fileCount":15,"unpackedSize":103333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrPSTCRA9TVsSAnZWagAAzO4QAJAXR2qyb9skh3JmCs2D\nChtvd0ME03rIBf1o1g2asbRfgo2Y5NX+2J/ji6vNWASCDhfczuxc3+qcky61\nTR7zbqteNJAyWIeRcRehAw9+xdZCFSLTYpwu6LDICfc5tu2Q3jyGfeKNdc/r\nuFTj9Q3T4Zz+G/BgD76NHaslWP7bawZ/LaFj/OcE0rPA5GQed40oQTyddMNx\ngrKXNu4WhZVlKXIdjwo9TMZONhueeAGtqb0NHOf2/4kqc700LC77pbydRE8n\nyh6jV0IsAPfTaEzGMtXMjNsIt8Mfj2j/OAohh6ONCZf9VfKy/u1Np17ce+w8\nz9tEsh0IXoLYxKF/Q4UlnCvjpVVJlu8u92UIj5hUH1zYTF+D9sSxPv0LCuyw\nwzsxbfKtQepMwF2NvT7Z++E0xQ4ForTyoBgoyP/Vm0CAjci2MbuCo6W01fyh\nzNZ/oajToofC4ruuS3LAGnvUjrrszdTo3BxsCR3wEn/IvfepgyLnu/8Nv+Ql\nkFDrRCmZvYJxZd2NgAKvSHW6okTINSdl4pBnJlOnPAa3QuOWdy3nys30Bdg/\nyl4Bj+75YvSSWHISdtG7zTwXi7Kgqh31OHSWY0tUAgzwaVP7dzJdrs+jlKfj\npL5yzYalC6pgqajJKIncpIun3fCRqrhqDEudCAmTclf9zdXhRt8HA/P/gfJq\nuOMw\r\n=bagD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkbdMB3MLET8BJAHjw/qpzeGsYZ7/vCE4Js4qWHX5B0wIgdtxmRDsNwqK9OVfBLHD/lqpVabVmx6GBbHfZB8iZpPw="}]},"_npmUser":{"name":"daizhen1995","email":"daizhen@know-act.com"},"directories":{},"maintainers":[{"name":"daizhen1995","email":"daizhen@know-act.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue3-clipboard_1.0.0_1605170322761_0.6735343919469035"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-12T08:38:42.761Z","1.0.0":"2020-11-12T08:38:42.898Z","modified":"2022-05-23T21:08:40.026Z"},"maintainers":[{"name":"daizhen1995","email":"daizhen@know-act.com"}],"description":"A Vuejs3 binding for clipboard.js","homepage":"https://github.com/Daizhen1995/vue3-clipboard#readme","keywords":["vue","vue3","clipboard","clipboard.js"],"repository":{"type":"git","url":"git+https://github.com/Daizhen1995/vue3-clipboard.git"},"author":{"name":"daizhen1995","email":"daizhen@know-act.com"},"bugs":{"url":"https://github.com/Daizhen1995/vue3-clipboard/issues"},"license":"ISC","readme":"# vue3-clipboard\n\nA simple vuejs 3 binding for clipboard.js, based on [Inndy/vue-clipboard2](https://github.com/Inndy/vue-clipboard2)\n\n## Install\n\n`npm install --save vue3-clipboard` or use `dist/vue3-clipboard.min.js` without npm\n\n## Usage\n\nFor vue-cli user:\n\n```javascript\nimport { createApp } from 'vue'\nimport VueClipboard from 'vue3-clipboard'\n\nconst app = createApp({})\n\napp.use(VueClipboard)\n```\n\nFor standalone usage:\n\n```html\n<script src=\"vue.min.js\"></script>\n<!-- must place this line after vue.js -->\n<script src=\"dist/vue3-clipboard.min.js\"></script>\n```\n\n## I want to copy texts without a specific button!\n\nYes, you can do it by using our new method: `this.$copyText`,\nwhere we replace the clipboard directives with a v-on directive.\n\nModern browsers have some limitations like that you can't use `window.open` without a user interaction.\nSo there's the same restriction on copying things! Test it before you use it. Make sure you are not\nusing this method inside any async method.\n\nBefore using this feature, read:\n[this issue](https://github.com/zenorocha/clipboard.js/issues/218) and\n[this page](https://github.com/zenorocha/clipboard.js/wiki/Known-Limitations) first.\n\n## It doesn't work with bootstrap modals\n\nSee [clipboardjs](https://clipboardjs.com/#advanced-usage) document and [this pull request](https://github.com/Inndy/vue-clipboard2/pull/23), `container` option is available like this:\n\nIn Options API:\n\n```js\nconst container = this.$refs.container\nthis.$copyText((text: 'Text to copy'), container)\n```\n\nIn Composition API:\n\n```js\nimport { copyText } from 'vue3-clipboard'\nimport { ref } from 'vue'\n\nconst container = ref(null)\ncopyText('Text to copy', container.value)\n```\n\nOr you can let `vue3-clipboard` set `container` to current element by doing this:\n\n```js\nimport { createApp } from 'vue'\nimport VueClipboard from 'vue3-clipboard'\n\nconst app = createApp({})\n\napp.use(VueClipboard, {\n  autoSetContainer: true,\n  appendToBody: true,\n})\n```\n\n## Sample\n\n```html\n<template>\n  <div class=\"container\">\n    <button type=\"button\" v-clipboard:copy=\"message\" v-clipboard:success=\"onCopy\" v-clipboard:error=\"onError\">\n      Copy!\n    </button>\n  </div>\n</template>\n\n<script>\n  export default {\n    setup() {\n      const message = 'Hello Clipborad!'\n      const onCopy = (e) => {\n        alert('You just copied: ' + e.text)\n      }\n      const onError = (e) => {\n        alert('Failed to copy texts')\n      }\n\n      return { message, onCopy, onError }\n    },\n  }\n</script>\n```\n\n## Sample 2\n\n```html\n<template>\n  <div class=\"container\">\n    <button type=\"button\" @click=\"doCopy\">Copy!</button>\n  </div>\n</template>\n\n<script>\n  import { copyText } from 'vue3-clipboard'\n\n  export default {\n    setup() {\n      const doCopy = () => {\n        copyText('Hello Clipborad', undefined, (error, event) => {\n          if (error) {\n            alert('Can not copy')\n            console.log(error)\n          } else {\n            alert('Copied')\n            console.log(event)\n          }\n        })\n      }\n\n      return { doCopy }\n    },\n  }\n</script>\n```\n","readmeFilename":"README.md"}