diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue index 56907c105..9c6959f75 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/component-library.vue @@ -14,16 +14,15 @@ import { componentConfigs } from './mobile/index'; /** 组件库:目前左侧的【基础组件】、【图文组件】部分 */ defineOptions({ name: 'ComponentLibrary' }); -// 组件列表 +/** 组件列表 */ const props = defineProps<{ list: DiyComponentLibrary[]; }>(); -// 组件分组 -const groups = reactive([]); -// 展开的折叠面板 -const extendGroups = reactive([]); -// 监听 list 属性,按照 DiyComponentLibrary 的 name 分组 +const groups = reactive([]); // 组件分组 +const extendGroups = reactive([]); // 展开的折叠面板 + +/** 监听 list 属性,按照 DiyComponentLibrary 的 name 分组 */ watch( () => props.list, () => { @@ -53,7 +52,7 @@ watch( }, ); -// 克隆组件 +/** 克隆组件 */ const handleCloneComponent = (component: DiyComponent) => { const instance = cloneDeep(component); instance.uid = Date.now(); @@ -62,7 +61,9 @@ const handleCloneComponent = (component: DiyComponent) => {