mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-30 18:39:18 +08:00
PlatformUtil.openURL支持H5平台文本添加剪切板
This commit is contained in:
@@ -26,7 +26,13 @@ export class PlatformUtil {
|
||||
}
|
||||
|
||||
/** 拷贝字符串到剪切板 */
|
||||
static copyText(text: string) {
|
||||
native.copyTextToClipboard(text);
|
||||
static async copyText(text: string) {
|
||||
if (sys.isNative) {
|
||||
native.copyTextToClipboard(text);
|
||||
|
||||
}
|
||||
else {
|
||||
await navigator.clipboard.writeText(text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user