41
41
42
42
<script >
43
43
import abstractField from " ../abstractField" ;
44
- import { debounce , isFunction , isNumber } from " lodash" ;
44
+ import { debounce , get as objGet , isFunction , isNumber } from " lodash" ;
45
45
import fecha from " fecha" ;
46
46
47
47
const DATETIME_FORMATS = {
@@ -50,8 +50,6 @@ const DATETIME_FORMATS = {
50
50
" datetime-local" : " YYYY-MM-DDTHH:mm:ss" ,
51
51
};
52
52
53
- const DEBOUNCE_FORMAT_MS = 1000 ;
54
-
55
53
export default {
56
54
mixins: [abstractField],
57
55
methods: {
@@ -115,8 +113,7 @@ export default {
115
113
case " range" :
116
114
this .debouncedFormatFunc = debounce ((newValue , oldValue ) => {
117
115
this .formatNumberToModel (newValue, oldValue);
118
- }
119
- , DEBOUNCE_FORMAT_MS , {
116
+ }, parseInt (objGet (this .schema , " debounceFormatTimeout" , 1000 )), {
120
117
trailing: true ,
121
118
leading: false
122
119
});
@@ -127,8 +124,7 @@ export default {
127
124
// wait 1s before calling 'formatDatetimeToModel' to allow user to input data
128
125
this .debouncedFormatFunc = debounce ((newValue , oldValue ) => {
129
126
this .formatDatetimeToModel (newValue, oldValue);
130
- }
131
- , DEBOUNCE_FORMAT_MS , {
127
+ }, parseInt (objGet (this .schema , " debounceFormatTimeout" , 1000 )), {
132
128
trailing: true ,
133
129
leading: false
134
130
});
0 commit comments