jdf2e / nutui

京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)
https://nutui.jd.com
MIT License
6.17k stars 835 forks source link

[BUG] AvatarGroup修改zIndex属性报错: Uncaught (in promise): Cannot read properties of undefined (reading 'style') #3114

Open Lzzzzzzy opened 5 months ago

Lzzzzzzy commented 5 months ago

NutUI 包名

@nutui/nutui-taro

NutUI 版本号

4.2.6

平台

weapp

重现链接

https://nutui.jd.com/playground/#eyJBcHAudnVlIjoiPHNjcmlwdCBzZXR1cCBsYW5nPVwidHNcIj5cbmltcG9ydCB7IERvbmdkb25nIH0gZnJvbSAnQG51dHVpL2ljb25zLXZ1ZSdcbjwvc2NyaXB0PlxuPHRlbXBsYXRlPlxuICA8bnV0LWF2YXRhci1ncm91cCBtYXgtY291bnQ9XCIzXCIgIG1heC1jb250ZW50PVwiLi4uXCIgc3Bhbj1cIi0xNlwiIHpJbmRleD1cInJpZ2h0XCI+XG4gICAgICA8bnV0LWF2YXRhcj5cbiAgICAgICAgICA8RG9uZ2RvbmcgLz5cbiAgICAgIDwvbnV0LWF2YXRhcj5cbiAgPC9udXQtYXZhdGFyLWdyb3VwPlxuPC90ZW1wbGF0ZT4ifQ==

重现步骤

  <nut-avatar-group max-count="3"  max-content="..." span="-16" zIndex="right">
      <nut-avatar>
          <Dongdong />
      </nut-avatar>
  </nut-avatar-group>

期望的结果是什么?

1.z-index属性改为right时, 当头像数量小于max-count时不显示max-content的内容

2.控制台不报错: Uncaught (in promise): Cannot read properties of undefined (reading 'style')

实际的结果是什么?

1.方向改成right后, 即使头像数量小于max-count也会显示max-content的内容 2.控制台报错Uncaught (in promise): Cannot read properties of undefined (reading 'style')

环境信息

No response

其他补充信息

No response

Lzzzzzzy commented 5 months ago

当头像数量大于等于max-count时就不会报错