mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
Improve widget performance
This commit is contained in:
parent
beaf2034d2
commit
528e1081ec
1 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
import { defineComponent } from 'vue';
|
||||
import { throttle } from 'throttle-debounce';
|
||||
import { Form } from '@/scripts/form';
|
||||
import * as os from '@/os';
|
||||
|
||||
|
@ -21,7 +22,10 @@ export default function <T extends Form>(data: {
|
|||
|
||||
data() {
|
||||
return {
|
||||
props: this.widget ? JSON.parse(JSON.stringify(this.widget.data)) : {}
|
||||
props: this.widget ? JSON.parse(JSON.stringify(this.widget.data)) : {},
|
||||
save: throttle(3000, () => {
|
||||
this.$emit('updateProps', this.props);
|
||||
}),
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -66,10 +70,6 @@ export default function <T extends Form>(data: {
|
|||
|
||||
this.save();
|
||||
},
|
||||
|
||||
save() {
|
||||
this.$emit('updateProps', this.props);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue