forked from FoundKeyGang/FoundKey
Save memo automatically (#5351)
* Save memo automatically * Use clearTimeout * Clean up * Clean up
This commit is contained in:
parent
9d65768d4d
commit
85721065fd
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,8 @@ export default define({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
text: null,
|
text: null,
|
||||||
changed: false
|
changed: false,
|
||||||
|
timeoutId: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -45,6 +46,8 @@ export default define({
|
||||||
|
|
||||||
onChange() {
|
onChange() {
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
|
clearTimeout(this.timeoutId);
|
||||||
|
this.timeoutId = setTimeout(this.saveMemo, 1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
saveMemo() {
|
saveMemo() {
|
||||||
|
|
Loading…
Reference in a new issue