xml代码
<navigation-bar title="Weixin" back="{{false}}" color="black" background="#FFF"><input placeholder="请输入内容" name="content" type="text" bindfocus="getClipboard" value="{{ code }}"/>
js代码
Page({data: { code:''},getClipboard:function(){var that = thiswx.getClipboardData({success:function(res){wx.showToast({title: '剪贴板内容是:'+res.data,icon:'none'})that.setData({code:res.data})},})return that.data.code}, })
效果展示