File tree Expand file tree Collapse file tree 5 files changed +116
-0
lines changed Expand file tree Collapse file tree 5 files changed +116
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ # See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+ # dependencies
5+ node_modules /
6+
7+ # testing
8+ /coverage
9+
10+ # misc
11+ .DS_Store
12+ .env.local
13+ .env.development.local
14+ .env.test.local
15+ .env.production.local
16+
17+ npm-debug.log *
18+ yarn-debug.log *
19+ yarn-error.log *
20+ package-lock.json *
21+
22+ # IDE
23+ /.idea
24+
25+ lib /
26+ es /
27+ dist /
28+ build /
29+ .vscode
30+
31+ # publish
32+ * .tgz
Original file line number Diff line number Diff line change 1+ vue-copy-to-cliboard
2+ ----
3+
4+ Copy to clipboard Vue component
Original file line number Diff line number Diff line change 1+ import copy from 'copy-to-clipboard'
2+
3+ export const CopyToClipboardProps = {
4+ text : {
5+ type : String ,
6+ required : true
7+ } ,
8+ options : {
9+ type : Object ,
10+ default : ( ) => { }
11+ }
12+ }
13+
14+ const CopyToClipboard = {
15+ name : 'VueCopyToClipboard' ,
16+ functional : true ,
17+ props : CopyToClipboardProps ,
18+ render ( h , ctx ) {
19+ const { props : { text, options = { } } , listeners : { copy : onCopy } } = ctx
20+
21+ const handleClick = ( e ) => {
22+ // Bypass onClick if it was present
23+ e . preventDefault ( )
24+ e . stopPropagation ( )
25+
26+ const result = copy ( text , options )
27+
28+ if ( onCopy ) {
29+ onCopy ( text , result )
30+ }
31+ }
32+
33+ return h ( 'span' , { on : { click : handleClick } } , ctx . children )
34+ }
35+ }
36+
37+ /* istanbul ignore next */
38+ CopyToClipboard . install = function ( Vue ) {
39+ Vue . component ( CopyToClipboard . name , CopyToClipboard )
40+ }
41+
42+ export default CopyToClipboard
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " vue-copy-to-clipboard" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " Copy to clipboard Vue component" ,
5+ "main" : " index.js" ,
6+ "repository" : " https://github.com/vueComponent/vue-copy-to-clipboard" ,
7+ "author" : " Sendya <18x@loacg.com>" ,
8+ "contributors" : [
9+ " Sendya <18x@loacg.com>"
10+ ],
11+ "license" : " MIT" ,
12+ "files" : [
13+ " es" ,
14+ " lib" ,
15+ " index.js"
16+ ],
17+ "peerDependencies" : {
18+ "vue" : " >=2.6.0"
19+ },
20+ "dependencies" : {
21+ "copy-to-clipboard" : " ^3.3.1"
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+ # yarn lockfile v1
3+
4+
5+ copy-to-clipboard@^3.3.1 :
6+ version "3.3.1"
7+ resolved "https://registry.npm.taobao.org/copy-to-clipboard/download/copy-to-clipboard-3.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcopy-to-clipboard%2Fdownload%2Fcopy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae"
8+ integrity sha1-EVqhqZmP+rYZb5MHatbaO5E2Yq4=
9+ dependencies :
10+ toggle-selection "^1.0.6"
11+
12+ toggle-selection@^1.0.6 :
13+ version "1.0.6"
14+ resolved "https://registry.npm.taobao.org/toggle-selection/download/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
15+ integrity sha1-bkWxJj8gF/oKzH2J14sVuL932jI=
You can’t perform that action at this time.
0 commit comments