Skip to content

Commit

Permalink
chore(window): 完善copyText方法的JsDoc @example
Browse files Browse the repository at this point in the history
  • Loading branch information
renzp94 committed Apr 23, 2024
1 parent 2efe697 commit a1dbcc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
*
* @param text 要复制的文本
* @returns 如果复制成功则返回true,否则返回false
*
* @example
* const status = await copyText('复制文本'); // true
* const text = await navigator.clipboard.readText();
* console.log(text); // 复制文本
*/
export const copyText = async (text: string) => {
try {
Expand Down

0 comments on commit a1dbcc9

Please sign in to comment.