diff --git a/apps/web-ele/src/views/mall/promotion/components/diy-editor/index.vue b/apps/web-ele/src/views/mall/promotion/components/diy-editor/index.vue index 4df691994..823c55e21 100644 --- a/apps/web-ele/src/views/mall/promotion/components/diy-editor/index.vue +++ b/apps/web-ele/src/views/mall/promotion/components/diy-editor/index.vue @@ -19,6 +19,7 @@ import { ElText, ElTooltip, } from 'element-plus'; +import draggable from 'vuedraggable'; import statusBarImg from '#/assets/imgs/diy/statusBar.png'; @@ -77,17 +78,20 @@ watch( isString(props.modelValue) && !isEmpty(props.modelValue) ? (JSON.parse(props.modelValue) as PageConfig) : props.modelValue; - // TODO @AI:这里可以简化么?idea 提示 Invalid 'typeof' check: 'modelValue' cannot have type 'string' + // noinspection SuspiciousTypeOfGuard pageConfigComponent.value.property = (typeof modelValue !== 'string' && modelValue?.page) || PAGE_CONFIG_COMPONENT.property; + // noinspection SuspiciousTypeOfGuard navigationBarComponent.value.property = (typeof modelValue !== 'string' && modelValue?.navigationBar) || NAVIGATION_BAR_COMPONENT.property; + // noinspection SuspiciousTypeOfGuard tabBarComponent.value.property = (typeof modelValue !== 'string' && modelValue?.tabBar) || TAB_BAR_COMPONENT.property; // 查找对应的页面组件 + // noinspection SuspiciousTypeOfGuard pageComponents.value = ( (typeof modelValue !== 'string' && modelValue?.components) || [] @@ -233,7 +237,6 @@ function handleCopyComponent(index: number) { /** 删除组件 */ function handleDeleteComponent(index: number) { - // 删除组件 pageComponents.value.splice(index, 1); if (index < pageComponents.value.length) { // 1. 不是最后一个组件时,删除后选中下面的组件 @@ -481,10 +484,10 @@ onMounted(() => {
-
手机扫码预览