File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,18 @@ import { UNI_STATUS_BAR_HEIGHT } from '@dcloudio/uni-shared'
66// #endif
77import { pruneComponentPropsCache } from './helpers/renderProps'
88
9+ // #if _X_
10+ function getStatusBarHeight ( ) {
11+ if ( typeof wx !== 'undefined' ) {
12+ return wx . getWindowInfo ( ) . statusBarHeight
13+ // @ts -expect-error
14+ } else if ( typeof my !== 'undefined' ) {
15+ // @ts -expect-error
16+ return my . getWindowInfo ( ) . statusBarHeight
17+ }
18+ }
19+ // #endif
20+
921export default {
1022 install ( app : App ) {
1123 initApp ( app )
@@ -14,8 +26,7 @@ export default {
1426 pruneComponentPropsCache
1527 // #if _X_
1628 // TODO 此处不支持 __GLOBAL__,并且有些小程序(如抖音小程序)没有 getWindowInfo 方法
17- app . config . globalProperties [ UNI_STATUS_BAR_HEIGHT ] =
18- wx . getWindowInfo ( ) . statusBarHeight
29+ app . config . globalProperties [ UNI_STATUS_BAR_HEIGHT ] = getStatusBarHeight ( )
1930 // #endif
2031 const oldMount = app . mount
2132 app . mount = function mount ( rootContainer : any ) {
You can’t perform that action at this time.
0 commit comments