1.0.9 • Published 3 years ago
@uni/clipboard v1.0.9
getClipboard
Install
$ npm install @uni/clipboard --save
or
$ npm install @uni/apis --save
Usage
import { getClipboard } from '@uni/clipboard';
getClipboard({
success (res){
console.log(res.text);
}
});
// promise
getClipboard().then(res => {
console.log(res.text);
});
Methods
getClipboard()
Gets the content on the system clipboard.
Supported
Arguments
Property | Type | Description | required | Default |
---|---|---|---|---|
options | object | ✔️ | - | |
options.success | Function | The callback function for a successful API call | ✘ | - |
options.fail | Function | The callback function for a failed API call | ✘ | - |
options.complete | Function | The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |
Return
Property | Type | Description |
---|---|---|
res | object | |
res.text | string | The clipboard content |
setClipboard
Sets the content on the system clipboard.
Supported
Usage
import { setClipboard } from '@uni/clipboard';
setClipboard({
text: 'text',
success (res){
console.log(res);
}
});
// promise
setClipboard({
text: 'text'
}).then(res => {
console.log(res);
});
Arguments
Property | Type | Description | required | Default |
---|---|---|---|---|
options | object | ✔️ | - | |
options.text | string | The clipboard content | ✔️ | - |
options.success | Function | The callback function for a successful API call | ✘ | - |
options.fail | Function | The callback function for a failed API call | ✘ | - |
options.complete | Function | The callback function used when the API call completed (always executed whether the call succeeds or fails) | ✘ | - |
1.0.9
3 years ago
1.0.9-beta.1
3 years ago
1.0.9-beta.2
3 years ago
1.0.9-beta.3
3 years ago
1.0.9-beta
3 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5-beta
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.4-beta
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
1.0.0-beta1
4 years ago
1.0.0-beta
4 years ago