Commit e62811ba authored by Bill's avatar Bill

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

parent 89db360f
...@@ -33,6 +33,7 @@ export interface SiteInfo { ...@@ -33,6 +33,7 @@ export interface SiteInfo {
logo: string; logo: string;
siteUrl: string; siteUrl: string;
symbol?: any; symbol?: any;
language: string;
} }
export interface Global { export interface Global {
......
...@@ -173,7 +173,7 @@ const createComponent = ( ...@@ -173,7 +173,7 @@ const createComponent = (
const sonConfig = createComponent( const sonConfig = createComponent(
{ {
componentName, componentName,
childrenData: current.childrenData, childrenData: current.childrenData.filter(Boolean),
startKey: keyNum, startKey: keyNum,
dataSource, dataSource,
primaryKey, primaryKey,
......
...@@ -117,6 +117,9 @@ function useSaveData(options: Options) { ...@@ -117,6 +117,9 @@ function useSaveData(options: Options) {
const { ...childRestProps } = childrenNodeTarget?.props; const { ...childRestProps } = childrenNodeTarget?.props;
const childrenData = childrenNodeTarget.childNodes?.map((_listItem) => { const childrenData = childrenNodeTarget.childNodes?.map((_listItem) => {
const sonNodeTarget = pageConfig[_listItem]; const sonNodeTarget = pageConfig[_listItem];
if (!sonNodeTarget?.props.id) {
return null
}
if (dataIndex === 'suggestProduct') { if (dataIndex === 'suggestProduct') {
return { return {
id: sonNodeTarget?.props.id, id: sonNodeTarget?.props.id,
...@@ -128,7 +131,7 @@ function useSaveData(options: Options) { ...@@ -128,7 +131,7 @@ function useSaveData(options: Options) {
return { return {
title: childRestProps.title, title: childRestProps.title,
theme: childRestProps.theme || 0, 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