From 908e234c6dbacce6f064472bac38bc88ed94a1e5 Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 31 Aug 2023 19:07:25 +0800 Subject: [PATCH] docs: update readme --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 895f84a..9be672b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ console.log(moneyFormat(money, 2)) # 使用文档 1. [isX](#isx) +1. [clipboard](#clipboard) 1. [cloneDeep](#clonedeep) 1. [debounce](#debounce) 1. [delay](#delay) @@ -111,6 +112,22 @@ isFunction // 是否是函数 isTrue // 是否是布尔 true 或者是字符 'true' isURL // 是否是 URL inBrowser // 是否在浏览器 +``` +### clipboard +```js +/** + * @description 剪贴板,返回一个 Promise + */ + +// 使用 +import { clipboard } from 'native-lodash' + +// 必须由用户主动触发 +const handleClipboard = async () => { + await clipboard() + // something... +} + ``` ### cloneDeep ```js @@ -132,7 +149,6 @@ obj === cloneObj // => true const cloneDeepObj = cloneDeep(obj) cloneDeepObj.name = 'wjw' obj === cloneDeepObj // => false - ``` ### debounce ```js