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);
|
this.$on('fieldReset', this.handleFieldReset);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.unmountPicker();
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
if (!this.ranged) {
|
if (!this.ranged) {
|
||||||
|
@ -919,8 +923,10 @@ export default {
|
||||||
if (typeof this.unwatchPickerOptions === 'function') {
|
if (typeof this.unwatchPickerOptions === 'function') {
|
||||||
this.unwatchPickerOptions();
|
this.unwatchPickerOptions();
|
||||||
}
|
}
|
||||||
|
if (this.picker.$el.parentNode) {
|
||||||
this.picker.$el.parentNode.removeChild(this.picker.$el);
|
this.picker.$el.parentNode.removeChild(this.picker.$el);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
emitChange(val) {
|
emitChange(val) {
|
||||||
|
|
Loading…
Reference in New Issue