提交 9823ab36 编写于 作者: 雪洛's avatar 雪洛

fix: windowTop 在低版本浏览器下值不正确的Bug askId: 89952

上级 bbf19521
......@@ -28,7 +28,7 @@ function updateCssVar (vm) {
const windowTopValue = navigationBarType === 'default' || navigationBarType === 'float' ? NAVBAR_HEIGHT : 0
const windowBottomValue = getApp().$children[0].showTabBar ? TABBAR_HEIGHT : 0
const envMethod = uni.canIUse('css.env') ? 'env' : (uni.canIUse('css.constant') ? 'constant' : '')
const windowTop = windowTopValue && envMethod ? `calc(${windowTopValue}px + ${envMethod}(safe-area-inset-top))` : `${windowTopValue}0px`
const windowTop = windowTopValue && envMethod ? `calc(${windowTopValue}px + ${envMethod}(safe-area-inset-top))` : `${windowTopValue}px`
const windowBottom = windowBottomValue && envMethod ? `calc(${windowBottomValue}px + ${envMethod}(safe-area-inset-bottom))` : `${windowBottomValue}px`
const style = document.documentElement.style
style.setProperty('--window-top', windowTop)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册