coco creator 怎么实现点击复制功能呢?为啥这样写手机上无效呢

let input:string = ‘测试’;

const el:any = window.document.createElement('textarea');

el.value = input;

// el.setAttribute('readonly', '');

el.style.contain = 'strict';

el.style.position = 'absolute';

el.style.left = '-9999px';

el.style.fontSize = '12pt'; // Prevent zooming on iOS

const selection:any = window.getSelection();

let originalRange:any = false;

if (selection.rangeCount > 0) {

    originalRange = selection.getRangeAt(0);

}

window.document.body.appendChild(el);

el.select();

el.selectionStart = 0;

el.selectionEnd = input.length;

let success:boolean = false;

try {

    success = window.document.execCommand('copy');

}catch(err) {

    

}

window.document.body.removeChild(el);

if (originalRange) {

    selection.removeAllRanges();

    selection.addRange(originalRange);

}

if(success){

  this.reBackTxt()

}

return success;

手机app还是手机上的网页?