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

使用组合图,提示TypeError: Cannot read properties of undefined (reading 'length') #5313

Closed
kemisstep opened this issue Jul 14, 2023 · 1 comment

Comments

@kemisstep
Copy link

  • G2 Version:
  • Platform:
  • Mini Showcase(like screenshots):
  • CodePen Link:

image

image

大致是:

const [dataColumnLine, setDataColumnLine] = useState([]);

    const GetDaCorp = async () => {
        const res = await apiGetDaCorp()
        const result = res.data.data
        setDataColumnLine(result)
        // console.log("GetDaCorp----res", result)
        setLoading(false);
    };

    useEffect(() => {

        GetDaCorp();

    }, []);

    return (
   {dataColumnLine && dataColumnLine.length === 0 ? (
                <div></div>) : (
                <DV_ColumnLine dataSource={dataColumnLine}
                    colsArr={defaultColsArr}>
                </DV_ColumnLine>)
            }
)

dataColumnLine 是封装的子组件,然后就报错了

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

1 participant