剪贴板(clipboard)
读取和写入系统剪贴板。
当在 tauri.conf.json
中设置 build.withGlobalTauri
为 true
时,该包也可以通过 window.__TAURI__.clipboard
访问。
这些 API 必须添加到 tauri.conf.json
的 tauri.allowlist.clipboard
中。
{
"tauri": {
"allowlist": {
"clipboard": {
"all": true, // enable all Clipboard APIs
"writeText": true,
"readText": true
}
}
}
}
建议仅将你使用的 API 加入白名单,以获得最佳的包大小和安全性。