#6911 save on enter #207
|
@ -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) {
|
||||||
jsegarra marked this conversation as resolved
alexm
commented
Review
```
if (event.key === 'Enter') {
event.preventDefault();
if (!event.shiftKey) insert();
}
```
👀
1
|
|||||||
|
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
|
||||||
alexm
commented
Cambiar traduccion Cambiar traduccion
jsegarra
commented
https://gitea.verdnatura.es/verdnatura/salix-front/commit/492e333d2fdb4aaa1d903f5b1f21d78e6641889f
|
|||||||
autofocus
|
autofocus
|
||||||
@keyup.enter.stop="insert"
|
@keyup="handleKeyUp"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
|
Loading…
Reference in New Issue