feat: paste task from button
This commit is contained in:
6844
pnpm-lock.yaml
generated
6844
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,11 @@ const extractTitleFromPaste = (
|
|||||||
return { title: null, content: text }
|
return { title: null, content: text }
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePaste = (event: ClipboardEvent) => {
|
const handlePaste = async (event?: ClipboardEvent) => {
|
||||||
const clipboardText = event.clipboardData?.getData('text')
|
const clipboardText = event
|
||||||
|
? event.clipboardData?.getData('text')
|
||||||
|
: await navigator.clipboard.readText()
|
||||||
|
|
||||||
if (!clipboardText) {
|
if (!clipboardText) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -82,6 +85,7 @@ onUnmounted(() => {
|
|||||||
<section class="message is-info paste-hint">
|
<section class="message is-info paste-hint">
|
||||||
<div class="message-body">
|
<div class="message-body">
|
||||||
Paste a list of items to directly create a new task
|
Paste a list of items to directly create a new task
|
||||||
|
<button @click="handlePaste" class="button is-info">Paste</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user