```html
<view v-if="userInfo.p_name||''" @tap="Cade_copy">
邀请码:{{userstoreCode}}
<text class="copy-btn">复制</text>
</view>
// 触发方法
Cade_copy() {
uni.setClipboardData({
data:this.userstoreCode,
success: function () {
console.log('success');
},
fail: function () {
console.log('复制失败');
},
});
},
``
`
https://uniapp.dcloud.io/api/system/clipboard?id=setclipboarddata