Skip to content
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

百度、快手小程序 flex 布局失效 #197

Open
ChrisCindy opened this issue Aug 4, 2021 · 0 comments · Fixed by #210
Open

百度、快手小程序 flex 布局失效 #197

ChrisCindy opened this issue Aug 4, 2021 · 0 comments · Fixed by #210
Labels
bug Something isn't working

Comments

@ChrisCindy
Copy link
Contributor

目前使用 Rax 小程序运行时方案开发百度、快手小程序时, flex 布局在会失效,例如:

<View style={{display: 'flex'}}>
  <View>1</View>
  <View>2</View>
</View>

原因在于Rax 运行时小程序方案使用 template 递归渲染节点,而 template 在百度、快手小程序是真实 DOM 节点,则上述结构渲染出的真实结构伪代码如下:

<template>
  <view style={{display: 'flex'}}>
    <template>
      <view>1</view>
    </template>
    <template>
      <view>2</view>
    </template>
  </view>
</template>

导致 flex 布局失效。因此,需要更新百度、快手侧的 view 等常用 flex 布局的组件的 template 模板,原理大致如 taro 社区用户讨论:NervJS/taro#6015 (comment)

@ChrisCindy ChrisCindy added the bug Something isn't working label Aug 4, 2021
@ChrisCindy ChrisCindy linked a pull request Aug 25, 2021 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant