From edaf7ec45b7499c94250fb3f2b5bfbeff278f773 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 14 Jan 2022 15:51:08 +0800 Subject: [PATCH] fix(Tabbar): get correct height in mobile safari (#10185) --- src/tabbar/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tabbar/index.js b/src/tabbar/index.js index 2e89602ed..d5d73cff2 100644 --- a/src/tabbar/index.js +++ b/src/tabbar/index.js @@ -56,7 +56,13 @@ export default createComponent({ mounted() { if (this.placeholder && this.fixed) { - this.height = this.$refs.tabbar.getBoundingClientRect().height; + const setHeight = () => { + this.height = this.$refs.tabbar.getBoundingClientRect().height; + }; + + setHeight(); + // https://github.com/youzan/vant/issues/10131 + setTimeout(setHeight, 100); } },