mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-24 21:40:48 +02:00
feat(plugins): use @tauri-apps namespace on NPM (#368)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
co-authored by
Amr Bashir
parent
caf8456864
commit
22991af9f4
@@ -1,23 +1,23 @@
|
||||
<script>
|
||||
import { writeText, readText } from 'tauri-plugin-clipboard-api'
|
||||
import { writeText, readText } from "@tauri-apps/plugin-clipboard";
|
||||
|
||||
export let onMessage
|
||||
let text = 'clipboard message'
|
||||
export let onMessage;
|
||||
let text = "clipboard message";
|
||||
|
||||
function write() {
|
||||
writeText(text)
|
||||
.then(() => {
|
||||
onMessage('Wrote to the clipboard')
|
||||
onMessage("Wrote to the clipboard");
|
||||
})
|
||||
.catch(onMessage)
|
||||
.catch(onMessage);
|
||||
}
|
||||
|
||||
function read() {
|
||||
readText()
|
||||
.then((contents) => {
|
||||
onMessage(`Clipboard contents: ${contents}`)
|
||||
onMessage(`Clipboard contents: ${contents}`);
|
||||
})
|
||||
.catch(onMessage)
|
||||
.catch(onMessage);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user