Skip to content

Commit a41aff9

Browse files
committed
fix(x-mp): 自定义组件跳过生成 --status-bar-height 的逻辑
1 parent 7083315 commit a41aff9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/uni-mp-compiler/src/transforms/transformRoot.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
createBindDirectiveNode,
99
isElementNode,
1010
isSimpleExpressionNode,
11+
isUserComponent,
1112
} from '@dcloudio/uni-cli-shared'
1213
import { UNI_STATUS_BAR_HEIGHT } from '@dcloudio/uni-shared'
1314
import type { NodeTransform, TransformContext } from '../transform'
@@ -94,6 +95,9 @@ function addStatusBarStyle(node: ElementNode, context: TransformContext) {
9495
}
9596

9697
function traverseChildren(node: ElementNode, context: TransformContext) {
98+
if (isUserComponent(node, context)) {
99+
return
100+
}
97101
if (node.tag !== 'template') {
98102
addStatusBarStyle(node, context)
99103
} else {

0 commit comments

Comments
 (0)