fix(Calendar): date is empty when poppable = fasle in dialog (#9845) (#9939)

This commit is contained in:
chenjiangui
2021-11-27 19:08:23 +08:00
committed by GitHub
parent ce6bda41ad
commit d4a29afb6a
2 changed files with 9 additions and 4 deletions

View File

@@ -103,10 +103,7 @@ export default createComponent({
methods: {
getHeight() {
if (!this.height) {
this.height = this.$el.getBoundingClientRect().height;
}
return this.height;
return this.$el?.getBoundingClientRect().height || 0;
},
scrollIntoView(body) {

View File

@@ -108,6 +108,12 @@ export default createComponent({
},
},
inject: {
vanPopup: {
default: null,
},
},
data() {
return {
subtitle: '',
@@ -165,6 +171,8 @@ export default createComponent({
mounted() {
this.init();
// https://github.com/youzan/vant/issues/9845
this.vanPopup?.$on('opened', this.onScroll);
},
/* istanbul ignore next */