mirror of https://github.com/ElemeFE/element
DatePicker: fix the memory leak when showTime is set to true
parent
290e68ea6a
commit
c4d089d8ea
|
@ -610,6 +610,10 @@ export default {
|
|||
this.$on('fieldReset', this.handleFieldReset);
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.unmountPicker();
|
||||
},
|
||||
|
||||
methods: {
|
||||
focus() {
|
||||
if (!this.ranged) {
|
||||
|
@ -919,8 +923,10 @@ export default {
|
|||
if (typeof this.unwatchPickerOptions === 'function') {
|
||||
this.unwatchPickerOptions();
|
||||
}
|
||||
if (this.picker.$el.parentNode) {
|
||||
this.picker.$el.parentNode.removeChild(this.picker.$el);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
emitChange(val) {
|
||||
|
|
Loading…
Reference in New Issue