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

Grid组件下使用动态组件混合固定组件添加GridItem时,白屏并报错:TypeError: Cannot read property 'columnNum' of undefined #657

Closed
1 of 7 tasks
xjkuchao opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@xjkuchao
Copy link

xjkuchao commented Jun 26, 2024

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

BUG 描述
Grid组件下使用动态组件混合固定组件添加GridItem时,白屏并报错:TypeError: Cannot read property 'columnNum' of undefined

复现步骤
以vantui/packages/vantui/src/grid/demo/demo3.tsx为例,只需要修改为

import { Grid, GridItem, Image } from '@antmjs/vantui'

export default function Demo() {
  return (
    <Grid columnNum="3" border={false}>
      {[1, 2, 3].map((index) => (
        <GridItem key={index}>
          <Image
            style="width: 100%; height: 90px;"
            src={`https://img.yzcdn.cn/vant/apple-${index + 1}.jpg`}
          />
        </GridItem>
      ))}
      <GridItem icon="plus" />
    </Grid>
  )
}

即可重现

期望结果
混合动态添加和固定GridItem时表现正常

实际结果
白屏并报错:TypeError: Cannot read property 'columnNum' of undefined

截图
image

环境
"@antmjs/vantui": "^3.4.3",
"@babel/runtime": "^7.24.7",
"@tarojs/components": "^3.6.32",
"@tarojs/helper": "^3.6.32",
"@tarojs/plugin-framework-react": "^3.6.32",
"@tarojs/plugin-html": "^3.6.32",
"@tarojs/plugin-http": "^3.6.32",
"@tarojs/plugin-platform-weapp": "^3.6.32",
"@tarojs/react": "^3.6.32",
"@tarojs/runtime": "^3.6.32",
"@tarojs/shared": "^3.6.32",
"@tarojs/taro": "^3.6.32",

附加信息

@zuolung zuolung added the bug Something isn't working label Jun 27, 2024
@zuolung zuolung closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants