export function useCopy() {
    const copy = (text: string) => {
		// #ifdef H5
		let transfer = document.createElement('input');
		document.body.appendChild(transfer);
		transfer.value = text;
		transfer.select();
		if (document.execCommand('copy')) {
			document.execCommand('copy');
		}
		transfer.blur();
		document.body.removeChild(transfer);
		// #endif
		// #ifndef H5
		uni.setClipboardData({
		    data: String(text),
			showToast:false
		})
		// #endif
        
    }
    return {
        copy
    }
}
