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

AtSwipeAction 加载时候报错TypeError: Cannot read properties of null (reading 'width') #1786

Open
Zhao187 opened this issue Apr 28, 2024 · 1 comment
Assignees

Comments

@Zhao187
Copy link

Zhao187 commented Apr 28, 2024

问题描述
taro3使用taro ui中的AtSwipeAction做滑动删除,界面加载中报错TypeError: Cannot read properties of null (reading 'width')

复现步骤

1.import {AtButton, AtList, AtListItem, AtNavBar,AtSwipeAction} from 'taro-ui'

<AtList hasBorder={true}>
          {
            this.state.list.map((item, index) => {
              return (
                <AtSwipeAction key={index} onClick={(data, index, event)=>{
   
                }} options={[
                  {
                    text: '删除',
                    style: {
                      backgroundColor: '#FF4949'
                    }
                  }
                ]}>
                  <AtListItem
                    key={index}
                    title={item.friendNickname}
                    thumb={item.friendFaceImage}
                    note={item.msg}
                    extraText={item.isRead ? '' : '未读'}
                  />
                </AtSwipeAction>
                )
            })
          }
        </AtList>

期望行为
控制台不报错,可以正常使用

报错信息
index.esm.js:6128 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'width')
at AtSwipeAction.eval (index.esm.js:6128:50)
at step (index.esm.js:218:17)
at Object.eval [as next] (index.esm.js:167:14)
at fulfilled (index.esm.js:126:24)

系统信息

  • Taro 版本 v3.6.27
  • Taro UI 版本 v3.3.0
  • 报错平台 h5, weapp

补充信息

Copy link

taro-ui-bot bot commented Apr 28, 2024

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@robinv8 robinv8 self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants