data-clipboard-text is not working while using clipboard.js

前端 未结 1 381
Happy的楠姐
Happy的楠姐 2021-01-24 01:54

I have a simple structure to test clipboard.js but it\'s not working.

I used in a simple file because it was not working in the project too:



        
1条回答
  •  时光取名叫无心
    2021-01-24 02:32

    you need to instantiate it by passing a DOM selector, HTML element, or list of HTML elements.

    new ClipboardJS('.btn');
    

    https://clipboardjs.com/#setup

    
    
    
    
      
      Document
    
    
    
      
      
      
    
    
    

    0 讨论(0)
提交回复
热议问题