uniapp点击按钮复制链接
<text style="color: #0075F7;">{{completeUrl}}</text> <u-button type="primary" @click="copyUrl(completeUrl)">复制URL</u-button>
copyUrl(url) { uni.showModal({ content: url, confirmText: '复制内容', success: () => { uni.setClipboardData({ data: url, success: function() { uni.hideToast({ title: '复制成功', duration: 2000, icon: 'none' }); }, fail: function(err) { uni.showToast({ title: '复制失败', duration: 2000, icon: 'none' }); } }); } }); },