check $refs.modal in observe callback

This commit is contained in:
DaxChen
2017-10-13 12:33:21 +08:00
parent 9352c2db64
commit 778fcff2cf
4 changed files with 16 additions and 19 deletions

View File

@@ -560,11 +560,6 @@
const afterEvent = this.genEventObject({ state })
this.$emit(afterEventName, afterEvent)
// recalculate the true modal height
if (state && this.isAutoHeight) {
this.updateRenderedHeight()
}
},
/**
@@ -574,8 +569,10 @@
* 2. MutationObserver's observe callback
*/
updateRenderedHeight () {
this.modal.renderedHeight = this.$refs.modal
.getBoundingClientRect().height
if (this.$refs.modal) {
this.modal.renderedHeight = this.$refs.modal
.getBoundingClientRect().height
}
},
/**