Skip to content

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

@ChrisCindy

Description

@ChrisCindy

目前使用 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions