jd-opensource / jd-opensource/taro-ui

SwipeAction支持父元素宽度自适应

Open
#1,818 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### 这个功能解决了什么问题?

SwipeAction所在容器宽度不是100vw的情况下,能够自适应容器宽度

### 你期望的功能是怎样的?

SwipeAction所在容器宽度不是100vw的情况下,能够自适应容器宽度,而不是始终为屏幕宽度

### 补充信息
```jsx


console.log(e)}
>
Width Should be 355px

```

在一些场景下,父元素是一个卡片样式的元素,它有外边距,因此父元素的宽度是不满100vw的,最近升级到TaroUI3.x,我注意到,在TaroUI2.x中,SwitchAction 会自动撑满父元素宽度的,但是3.x中,areaWidth 的值为 `systemInfo.windowWidth`,即屏幕宽度,这导致了 SwitchAction 的子元素宽度超出了父元素卡片的宽度在UI呈现上溢出了

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.