
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@uni/clipboard
Advanced tools
[](https://www.npmjs.com/package/@uni/clipboard)
$ npm install @uni/clipboard --save
or
$ npm install @uni/apis --save
import { getClipboard } from '@uni/clipboard';
getClipboard({
success (res){
console.log(res.text);
}
});
// promise
getClipboard().then(res => {
console.log(res.text);
});
getClipboard()
获取系统剪贴板的内容
h5 暂不支持此方法
成员 | 类型 | 描述 | 必选 | 默认值 |
---|---|---|---|---|
options | object | ✔️ | - | |
options.success | Function | 成功的回调 | ✘ | - |
options.fail | Function | 失败的回调 | ✘ | - |
options.complete | Function | 结束的回调 (调用成功、失败都会执行) | ✘ | - |
成员 | 类型 | 描述 |
---|---|---|
res | object | |
res.text | string | 剪贴板的内容 |
设置系统剪贴板的内容。
import { setClipboard } from '@uni/clipboard';
setClipboard({
text: 'text',
success (res){
console.log(res);
}
});
// promise
setClipboard({
text: 'text'
}).then(res => {
console.log(res);
});
成员 | 类型 | 描述 | 必选 | 默认值 |
---|---|---|---|---|
options | object | ✔️ | - | |
options.text | string | 剪切板数据 | ✔️ | - |
options.success | Function | 成功的回调 | ✘ | - |
options.fail | Function | 失败的回调 | ✘ | - |
options.complete | Function | 结束的回调 (调用成功、失败都会执行) | ✘ | - |
FAQs
[](https://www.npmjs.com/package/@uni/clipboard)
The npm package @uni/clipboard receives a total of 868 weekly downloads. As such, @uni/clipboard popularity was classified as not popular.
We found that @uni/clipboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.