npm i --save @nativescript-use/nativescript-clipboard
- 版本: 0.0.3
- GitHub: https://github.com/NativeScript/plugins
- NPM: https://npmjs.net.cn/package/%40nativescript-use%2Fnativescript-clipboard
- 下载量
- 昨日: 0
- 上周: 0
- 上月: 0
@nativescript-use/nativescript-clipboard
npm install @nativescript-use/nativescript-clipboard
使用情况
import { Clipboard } from "@nativescript-use/nativescript-clipboard"
const clipboard = new Clipboard();
// Copy text
clipboard.copy("My text");
// Read Clipboard
const currentClipboardValue = clipboard.read();
// Add listener
clipboard.onCopy((textCopied: string) =>{
console.log(textCopied)
});
// Remove listener
clipboard.offCopy();
类型声明
export declare class Clipboard {
abstract onCopy(callback: (text: string) => void): void
abstract offCopy(): void
abstract copy(text: string): boolean
abstract read(): string
}
许可证
Apache 许可协议版本 2.0