fix(NavBar): get correct height in mobile safari (#10190)

This commit is contained in:
neverland
2022-01-15 20:01:55 +08:00
committed by GitHub
parent 22ee50576c
commit 6ed16c0770

View File

@@ -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);
}
},