mirror of
https://github.com/Lissy93/dashy.git
synced 2025-12-06 08:34:14 +01:00
Add launchApp support for target:clipboard to copy text to clipboard
This commit is contained in:
parent
a4f76c6b0b
commit
32e3f3d38c
1 changed files with 10 additions and 0 deletions
|
|
@ -46,6 +46,16 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
launchApp(options) {
|
||||
const { url, target } = options;
|
||||
if (target === 'clipboard') {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(url);
|
||||
this.$toasted.show('Copied to clipboard!');
|
||||
} else {
|
||||
this.$toasted.show('Clipboard API not supported');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (options.target === 'newtab') {
|
||||
window.open(options.url, '_blank');
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue