fix(input-item): create debounce method dynamically

variables inner debounce will be shared by multiple component instance
This commit is contained in:
xuxiaoyan 2021-01-15 11:05:29 +08:00
parent e7ecca6fee
commit 2a70900dba
1 changed files with 4 additions and 3 deletions

View File

@ -324,6 +324,9 @@ export default {
},
created() {
this.inputValue = this.$_formateValue(this.$_subValue(this.value + '')).value
this.$_stopEditInput = debounce(function() {
this.isInputEditing = false
}, 500)
},
mounted() {
this.isVirtualKeyboard &&
@ -423,9 +426,7 @@ export default {
this.isInputEditing = true
this.$_stopEditInput()
},
$_stopEditInput: debounce(function() {
this.isInputEditing = false
}, 500),
$_stopEditInput: noop,
$_clearInput() {
this.inputValue = ''
!this.isTitleLatent && this.focus()