如果是简单的html页面设置一个按钮点击按钮可以实现复制,但是用creator中的创建的按钮,点击按钮在ios手机浏览器不能实现复制,这个问题怎么解决呢,安卓手机正常
copyText (text:string) {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('readonly', 'readonly')
input.setAttribute('value', text)
input.select()
input.setSelectionRange(0, text.length)
try {
document.execCommand('copy')
} catch (err) { }
document.body.removeChild(input)
}
-
Creator 版本:
-
目标平台:
-
重现方式:
-
首个报错:
-
之前哪个版本是正常的:
-
手机型号:
-
手机浏览器:
-
编辑器操作系统:
-
重现概率: