From a1d6c398b68f9e71f11a82f9e87fa20132698231 Mon Sep 17 00:00:00 2001 From: hufeixiong Date: Tue, 1 Mar 2022 15:37:39 +0800 Subject: [PATCH] update --- .../plugin/formComponents/animateControl.tsx | 1 + packages/dooringx-example/src/plugin/index.tsx | 7 +++++++ .../src/plugin/registComponents/testCo.tsx | 17 +++++++++++++++++ .../dooringx-lib/src/components/rightConfig.tsx | 6 +++++- .../dooringx-lib/src/core/store/storetype.ts | 1 + 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 packages/dooringx-example/src/plugin/registComponents/testCo.tsx diff --git a/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx b/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx index 4ecb1b9..6a026ef 100644 --- a/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx +++ b/packages/dooringx-example/src/plugin/formComponents/animateControl.tsx @@ -356,6 +356,7 @@ function AnimateControl(props: AnimateControlProps) { > 添加动画 + ); diff --git a/packages/dooringx-example/src/plugin/index.tsx b/packages/dooringx-example/src/plugin/index.tsx index beb88e7..78c0530 100644 --- a/packages/dooringx-example/src/plugin/index.tsx +++ b/packages/dooringx-example/src/plugin/index.tsx @@ -29,6 +29,13 @@ const LeftRegistMap: LeftRegistComponentMapItem[] = [ img: 'https://img.guguzhu.com/d/file/android/ico/2021/09/08/rytzi2w34tm.png', displayName: '输入框', }, + { + type: 'basic', + component: 'test', + img: 'https://img.guguzhu.com/d/file/android/ico/2021/09/08/rytzi2w34tm.png', + displayName: '测试', + urlFn: () => import('./registComponents/testCo'), + }, ]; export const defaultConfig: Partial = { diff --git a/packages/dooringx-example/src/plugin/registComponents/testCo.tsx b/packages/dooringx-example/src/plugin/registComponents/testCo.tsx new file mode 100644 index 0000000..e2eccc6 --- /dev/null +++ b/packages/dooringx-example/src/plugin/registComponents/testCo.tsx @@ -0,0 +1,17 @@ +import { ComponentItemFactory } from 'dooringx-lib'; + +const TestCo = new ComponentItemFactory( + 'test', + '测试组件', + {}, + { + width: 200, + height: 55, + }, + () => { + return
测试
; + }, + true +); + +export default TestCo; diff --git a/packages/dooringx-lib/src/components/rightConfig.tsx b/packages/dooringx-lib/src/components/rightConfig.tsx index e649d43..3fa349a 100644 --- a/packages/dooringx-lib/src/components/rightConfig.tsx +++ b/packages/dooringx-lib/src/components/rightConfig.tsx @@ -84,7 +84,11 @@ function RightConfig(props: PropsWithChildren) { ); }); } else { - return
{replaceLocale('right.noprops', '还没有配置属性', props.config)}
; + return ( +
+ {replaceLocale('right.noprops', '还没有配置属性', props.config)} +
+ ); } } return null; diff --git a/packages/dooringx-lib/src/core/store/storetype.ts b/packages/dooringx-lib/src/core/store/storetype.ts index 1f676c6..7043665 100644 --- a/packages/dooringx-lib/src/core/store/storetype.ts +++ b/packages/dooringx-lib/src/core/store/storetype.ts @@ -26,6 +26,7 @@ export interface AnimateItem { animationDelay: number; animationIterationCount: string; animationTimingFunction: string; + isCustom?: boolean; } export interface IBlockType {