jdf2e / nutui

京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)
https://nutui.jd.com
MIT License
6.1k stars 829 forks source link

navbar 编译到微信小程序时safe-area-inset-top属性不生效 #1850

Closed sperains closed 1 year ago

sperains commented 1 year ago

NutUI scenes(nutui 场景)

小程序(@nutui/nutui-taro)

NutUI-vue version(nutui-vue 版本)

3.2.6

Vue version(vue 版本)

3.2.45

Operating environment(运行环境)

dev:weapp

Citation method(引用方式)

npm

Node version(node 版本)

16.9.1

Browser and its version(浏览器及其版本)

webapp

System and its version(系统及其版本)

12.6

Taro environmental information(taro 环境信息)

👽 Taro v3.5.6

Taro CLI 3.5.6 environment info: System: OS: macOS 12.6 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.9.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 7.21.1 - /usr/local/bin/npm npmPackages: @tarojs/cli: 3.5.6 => 3.5.6 @tarojs/components: 3.5.6 => 3.5.6 @tarojs/helper: 3.5.6 => 3.5.6 @tarojs/plugin-framework-vue3: 3.5.6 => 3.5.6 @tarojs/plugin-html: 3.5.6 => 3.5.6 @tarojs/plugin-platform-alipay: 3.5.6 => 3.5.6 @tarojs/plugin-platform-jd: 3.5.6 => 3.5.6 @tarojs/plugin-platform-qq: 3.5.6 => 3.5.6 @tarojs/plugin-platform-swan: 3.5.6 => 3.5.6 @tarojs/plugin-platform-tt: 3.5.6 => 3.5.6 @tarojs/plugin-platform-weapp: 3.5.6 => 3.5.6 @tarojs/router: 3.5.6 => 3.5.6 @tarojs/runtime: 3.5.6 => 3.5.6 @tarojs/shared: 3.5.6 => 3.5.6 @tarojs/taro: 3.5.6 => 3.5.6 @tarojs/taro-h5: 3.5.6 => 3.5.6 @tarojs/webpack5-runner: 3.5.6 => 3.5.6 babel-preset-taro: 3.5.6 => 3.5.6 eslint-config-taro: 3.5.6 => 3.5.6 npmGlobalPackages: typescript: 4.9.3

Reproduction link(重现链接)

github.com

Steps to reproduce(重现步骤)

  1. app.ts 添加Tabbar
  2. pages/index/index.config.ts 添加 navigationStyle: "custom",
  3. pages/index.vue 添加 nut-navbar 组件

What is expected?(期望的结果是什么?)

navbar不被刘海屏遮挡

What is actually happening?(实际的结果是什么?)

navbar被遮挡

Remarks(补充说明)

麻烦大佬们, 创建一个nut-ui/vue3 模板, 然后添加一个navbar看看

Drjingfubo commented 1 year ago

微信小程序设置navigationStyle: "custom",需要自行给根元素添加一个状态栏高度 const windowInfo = Taro.getWindowInfo() let height = windowInfo.statusBarHeight .root(根元素){ padding:top; }

sperains commented 1 year ago

感谢回复