fix: 智聪健康微信小程序版本,代码提交。
This commit is contained in:
@@ -22,6 +22,7 @@ export default {
|
||||
}
|
||||
|
||||
function copyTextToClipboard(input, { target = document.body } = {}) {
|
||||
// #ifdef H5
|
||||
const element = document.createElement('textarea');
|
||||
const previouslyFocusedElement = document.activeElement;
|
||||
|
||||
@@ -63,4 +64,18 @@ function copyTextToClipboard(input, { target = document.body } = {}) {
|
||||
}
|
||||
|
||||
return isSuccess;
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
// 使用 uni-app 的剪贴板 API
|
||||
uni.setClipboardData({
|
||||
data: input,
|
||||
success: function () {
|
||||
return true;
|
||||
},
|
||||
fail: function () {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user