diff --git a/src/nav-bar/index.js b/src/nav-bar/index.js index 3e43cf120..1a64c783f 100644 --- a/src/nav-bar/index.js +++ b/src/nav-bar/index.js @@ -31,7 +31,13 @@ export default createComponent({ mounted() { if (this.placeholder && this.fixed) { - this.height = this.$refs.navBar.getBoundingClientRect().height; + const setHeight = () => { + this.height = this.$refs.navBar.getBoundingClientRect().height; + }; + + setHeight(); + // https://github.com/youzan/vant/issues/10131 + setTimeout(setHeight, 100); } },