forked from verdnatura/salix-front
fix: handle VnNotes keyup
This commit is contained in:
parent
0450986025
commit
5139bba5a0
|
@ -20,7 +20,14 @@ const state = useState();
|
|||
const currentUser = ref(state.getUser());
|
||||
const newNote = ref('');
|
||||
const vnPaginateRef = ref();
|
||||
|
||||
function handleKeyUp(event) {
|
||||
if (event.key === 'Enter' && event.shiftKey) {
|
||||
event.preventDefault();
|
||||
} else if (event.key === 'Enter') {
|
||||
insert();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
async function insert() {
|
||||
const body = $props.body;
|
||||
Object.assign(body, { text: newNote.value });
|
||||
|
@ -48,7 +55,7 @@ async function insert() {
|
|||
size="lg"
|
||||
autogrow
|
||||
autofocus
|
||||
@keyup.enter.stop="insert"
|
||||
@keyup="handleKeyUp"
|
||||
clearable
|
||||
>
|
||||
<template #append>
|
||||
|
|
Loading…
Reference in New Issue