jdf2e / nutui-react

京东风格的移动端 React 组件库 、支持多端小程序(A React UI Toolkit for Mobile Web)
https://nutui.jd.com/react/
919 stars 263 forks source link

Animate导致Button block属性失效 #2715

Open MoonBite666 opened 2 weeks ago

MoonBite666 commented 2 weeks ago

NutUI React 包名

@nutui/nutui-react-taro

NutUI React 版本号

2.7.0

平台

h5

重现链接

https://codesandbox.io/p/devbox/cool-lena-8gtxmg?workspaceId=c8bc3786-2eac-4df1-a0db-e4f77d228eb1

重现步骤

正常使用Button组件中的block属性时,元素可以作为块级元素占据所有宽度。

<Button type="primary" block size="large">
      NutUI React 2.0
</Button>

image

如果外层嵌套Animate组件,Button就无法占据所有宽度

<Animate type="flicker" loop>
  <Button type="primary" block size="large">
     NutUI React 2.0
  </Button>
</Animate>

image

期望的结果是什么?

Animate包裹下,Button的block属性生效

实际的结果是什么?

Animate包裹下,Button的block属性未生效

环境信息

Taro CLI 4.0.7 environment info: System: OS: Windows 11 10.0.22631 Binaries: Node: 22.7.0 - ~\scoop\apps\nodejs\current\node.EXE Yarn: 1.22.22 - ~\scoop\apps\yarn\current\bin\yarn.CMD npm: 10.8.2 - ~\scoop\apps\nodejs\current\npm.CMD npmPackages: @tarojs/cli: 4.0.7 => 4.0.7 @tarojs/components: 4.0.7 => 4.0.7 @tarojs/helper: 4.0.7 => 4.0.7 @tarojs/plugin-framework-react: 4.0.7 => 4.0.7 @tarojs/plugin-html: ^4.0.7 => 4.0.7 @tarojs/plugin-platform-alipay: 4.0.7 => 4.0.7 @tarojs/plugin-platform-h5: 4.0.7 => 4.0.7 @tarojs/plugin-platform-harmony-hybrid: 4.0.7 => 4.0.7 @tarojs/plugin-platform-jd: 4.0.7 => 4.0.7 @tarojs/plugin-platform-qq: 4.0.7 => 4.0.7 @tarojs/plugin-platform-swan: 4.0.7 => 4.0.7 @tarojs/plugin-platform-tt: 4.0.7 => 4.0.7 @tarojs/plugin-platform-weapp: 4.0.7 => 4.0.7 @tarojs/react: 4.0.7 => 4.0.7 @tarojs/runtime: 4.0.7 => 4.0.7 @tarojs/shared: 4.0.7 => 4.0.7 @tarojs/taro: 4.0.7 => 4.0.7 @tarojs/taro-loader: 4.0.7 => 4.0.7 @tarojs/webpack5-runner: 4.0.7 => 4.0.7 babel-preset-taro: 4.0.7 => 4.0.7 eslint-config-taro: 4.0.7 => 4.0.7 react: ^18.0.0 => 18.3.1

其他补充信息

No response