pk10赛车计划软件百度云

Fuzhou website construction only needs 1,000 yuan to include domain name space, details 18558752805

  • WeChat applet click to copy text to clipboard

Fuzhou Website Construction > Site News > WeChat Mini Program >

Call the interface of the applet to implement, there is no difficulty, just go to the code directly.

wxml:

  view >内容:{{contents}} </ view > < view bindtap ='copyText' data-text ="{{contents}}" >复制</ view > < view > Content: {{contents}} </ view > < view bindtap = 'copyText' data-text = "{{contents}}" > Copy </ view > 

js:

Copy code
  Page ({ 
    data: { 
      '这是可以复制的文字,粘贴后即可看到效果'  }, contents: 'This is text that can be copied, and the effect can be seen after pasting' }, 
    function  (e) { copyText: function (e) { 
      console.log (e) 
      wx.setClipboardData ({ 
        data: e.currentTarget.dataset.text, 
        function  (res) { success: function (res) { 
          wx.getClipboardData ({ 
            function  (res) { success: function (res) { 
              wx.showToast ({ 
                '复制成功'  }) title: 'Copy successfully' )) 
            } 
          }) 
        } 
      }) 
    }, 
  }) 
Copy code
Scan QR code to share on WeChat
confirm

Copyright © 2014-2019 buxie520.com Fuzhou website production