Skip to content
Snippets Groups Projects
Commit 65fbca47 authored by syuilo's avatar syuilo
Browse files

Improve widget performance

parent 53c7077d
No related branches found
Tags 10.94.0
No related merge requests found
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);
}
}
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment