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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

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

View File

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