summaryrefslogtreecommitdiff
path: root/src/client/widgets/define.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-02-21 13:38:29 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-02-21 13:38:29 +0900
commit3d68a0988bb40567e71a23cbe809d9eff4e1a2c0 (patch)
treedbecada3558bfaeef7ae72a44c0e643f678f252a /src/client/widgets/define.ts
parentMerge branch 'develop' (diff)
parent12.71.0 (diff)
downloadmisskey-3d68a0988bb40567e71a23cbe809d9eff4e1a2c0.tar.gz
misskey-3d68a0988bb40567e71a23cbe809d9eff4e1a2c0.tar.bz2
misskey-3d68a0988bb40567e71a23cbe809d9eff4e1a2c0.zip
Merge branch 'develop'
Diffstat (limited to 'src/client/widgets/define.ts')
-rw-r--r--src/client/widgets/define.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/widgets/define.ts b/src/client/widgets/define.ts
index b5498204b3..08a346d97c 100644
--- a/src/client/widgets/define.ts
+++ b/src/client/widgets/define.ts
@@ -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);
- }
}
});
}