MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / copy

Function copy

web/src/helpers/utils.js:52–71  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

50}
51
52export async function copy(text) {
53 let okay = true;
54 try {
55 await navigator.clipboard.writeText(text);
56 } catch (e) {
57 try {
58 // 构建input 执行 复制命令
59 var _input = window.document.createElement('input');
60 _input.value = text;
61 window.document.body.appendChild(_input);
62 _input.select();
63 window.document.execCommand('Copy');
64 window.document.body.removeChild(_input);
65 } catch (e) {
66 okay = false;
67 console.error(e);
68 }
69 }
70 return okay;
71}
72
73// isMobile 函数已移除,请改用 useIsMobile Hook
74

Callers 15

handleSubmitFunction · 0.90
TaskLogsTable.jsFile · 0.90
MjLogsTable.jsFile · 0.90
LogsTable.jsFile · 0.90
ModelPricing.jsFile · 0.90
TokensTable.jsFile · 0.90
generateAccessTokenFunction · 0.90
handleSystemTokenClickFunction · 0.90
copyTextFunction · 0.90
CodeViewer.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected