-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序组合(props.renderChildren )会被多余的 view 包裹 #5020
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
使用组合时,renderChildren 时 Taro 会为 children 包裹一层
<View />
复现步骤
从 1.3.14 后都有此行为,使用下面代码就可以复现
npm run build:weapp
可以在 dist 文件夹中找到pages/index/index.wxml
,代码如下期望行为
可以看到,生成的代码中
slot="header"
没有在<view>header</view>
上,而是将<view>header</view>
包裹了一层<view>
,并在这层<view>
上添加了 slot。这导致了无论是组件 Dialog 还是调用方都无法控制新增加的
<view>
样式,给开发增加了很多难度。而在 1.3.13 时 build 后的代码没有这层新增加的<view>
。报错信息
系统信息
补充信息
造成这个问题的原因可能是这个 commit
The text was updated successfully, but these errors were encountered: