Commit e62811ba authored by Bill's avatar Bill

fix: 修改活动页商品数据为空时报错

parent 89db360f
......@@ -33,6 +33,7 @@ export interface SiteInfo {
logo: string;
siteUrl: string;
symbol?: any;
language: string;
}
export interface Global {
......
......@@ -173,7 +173,7 @@ const createComponent = (
const sonConfig = createComponent(
{
componentName,
childrenData: current.childrenData,
childrenData: current.childrenData.filter(Boolean),
startKey: keyNum,
dataSource,
primaryKey,
......
......@@ -117,6 +117,9 @@ function useSaveData(options: Options) {
const { ...childRestProps } = childrenNodeTarget?.props;
const childrenData = childrenNodeTarget.childNodes?.map((_listItem) => {
const sonNodeTarget = pageConfig[_listItem];
if (!sonNodeTarget?.props.id) {
return null
}
if (dataIndex === 'suggestProduct') {
return {
id: sonNodeTarget?.props.id,
......@@ -128,7 +131,7 @@ function useSaveData(options: Options) {
return {
title: childRestProps.title,
theme: childRestProps.theme || 0,
childrenData: childrenData
childrenData: childrenData.filter(Boolean)
};
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment