From a4bd736a8ccaa08394831cc77f8108b3c9e5ce5f Mon Sep 17 00:00:00 2001 From: yangmi Date: Fri, 22 Jul 2022 15:37:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20eventConfig=E4=B8=BA=E7=A9=BA=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .../components/PreviewRenderList/PreViewRenderItem.vue | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 00e4e9e3..42331951 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ dist dist-ssr *.local .vscode -./stats.html \ No newline at end of file +stats.html \ No newline at end of file diff --git a/src/views/preview/components/PreviewRenderList/PreViewRenderItem.vue b/src/views/preview/components/PreviewRenderList/PreViewRenderItem.vue index 090a322b..29cc98ea 100644 --- a/src/views/preview/components/PreviewRenderList/PreViewRenderItem.vue +++ b/src/views/preview/components/PreviewRenderList/PreViewRenderItem.vue @@ -17,6 +17,7 @@ import { getSizeStyle } from '../../utils' import { EventTriggerType } from '@/enums/eventEnum' import { CreateComponentType, EventConfig } from '@/packages/index.d' import { newFunctionHandle } from '@/utils' +import isObject from 'lodash/isObject' const props = defineProps({ item: { @@ -49,7 +50,8 @@ const bus = useEventBus() * } */ const getEventList = (eventConfig: EventConfig) => { - const res = Object.keys(eventConfig) // 剔除other字段 + if(!isObject(eventConfig)) return {} + const res = Object.keys(eventConfig) .reduce((previousValue: EventConfig, currentValue: string) => { // @ts-ignore previousValue[currentValue] = eventConfig[currentValue].methodList.map((item: any) => {