mirror of
https://github.com/youzan/vant.git
synced 2026-01-20 07:00:14 +08:00
fix(NavBar): get correct height in mobile safari (#10190)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user