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 currentUser = ref(state.getUser());
|
||||||
const newNote = ref('');
|
const newNote = ref('');
|
||||||
const vnPaginateRef = 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() {
|
async function insert() {
|
||||||
const body = $props.body;
|
const body = $props.body;
|
||||||
Object.assign(body, { text: newNote.value });
|
Object.assign(body, { text: newNote.value });
|
||||||
|
@ -48,7 +55,7 @@ async function insert() {
|
||||||
size="lg"
|
size="lg"
|
||||||
autogrow
|
autogrow
|
||||||
autofocus
|
autofocus
|
||||||
@keyup.enter.stop="insert"
|
@keyup="handleKeyUp"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
Loading…
Reference in New Issue