File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11{
22  "name" : " vue-clipboard2" 
3-   "version" : " 0.3.1 " 
4-   "description" : " A Vuejs2 binding for clipboard.js" 
3+   "version" : " 0.3.2 " 
4+   "description" : " A Vuejs2 & Vuejs3  binding for clipboard.js" 
55  "main" : " vue-clipboard.js" 
66  "scripts" : {
77    "build" : " $(npm bin)/eslint vue-clipboard.js && $(npm bin)/browserify browserify-me.js -o dist/vue-clipboard.js && $(npm bin)/uglifyjs dist/vue-clipboard.js -o dist/vue-clipboard.min.js && echo Success" 
Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ var VueClipboardConfig = {
77
88var  VueClipboard  =  { 
99  install : function  ( Vue )  { 
10-     Vue . prototype . $clipboardConfig  =  VueClipboardConfig 
11-     Vue . prototype . $copyText  =  function  ( text ,  container )  { 
10+     var  globalPrototype  =  Vue . version . slice ( 0 ,  2 )  ===  '3.'  ? Vue . config . globalProperties  : Vue . prototype 
11+     globalPrototype . $clipboardConfig  =  VueClipboardConfig 
12+     globalPrototype . $copyText  =  function  ( text ,  container )  { 
1213      return  new  Promise ( function  ( resolve ,  reject )  { 
1314        var  fakeElement  =  document . createElement ( 'button' ) 
1415        var  clipboard  =  new  Clipboard ( fakeElement ,  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments