feat:【mall】diy editor 恢复中间,宽度还有点问题

pull/242/head
YunaiV 2025-10-28 07:45:27 +08:00
parent fd58c4c4e4
commit b5c8197f20
3 changed files with 25 additions and 30 deletions

View File

@ -49,9 +49,8 @@ const emits = defineEmits<{
type DiyComponentWithStyle = DiyComponent<any> & {
property: { style?: ComponentStyle };
};
/**
* 组件样式
*/
/** 组件样式 */
const style = computed(() => {
const componentStyle = props.component.property.style;
if (!componentStyle) {
@ -78,24 +77,17 @@ const style = computed(() => {
};
});
/**
* 移动组件
* @param direction 移动方向
*/
/** 移动组件 */
const handleMoveComponent = (direction: number) => {
emits('move', direction);
};
/**
* 复制组件
*/
/** 复制组件 */
const handleCopyComponent = () => {
emits('copy');
};
/**
* 删除组件
*/
/** 删除组件 */
const handleDeleteComponent = () => {
emits('delete');
};

View File

@ -14,16 +14,15 @@ import { componentConfigs } from './mobile/index';
/** 组件库:目前左侧的【基础组件】、【图文组件】部分 */
defineOptions({ name: 'ComponentLibrary' });
//
/** 组件列表 */
const props = defineProps<{
list: DiyComponentLibrary[];
}>();
//
const groups = reactive<any[]>([]);
//
const extendGroups = reactive<string[]>([]);
// list DiyComponentLibrary name
const groups = reactive<any[]>([]); //
const extendGroups = reactive<string[]>([]); //
/** 监听 list 属性,按照 DiyComponentLibrary 的 name 分组 */
watch(
() => props.list,
() => {
@ -53,7 +52,7 @@ watch(
},
);
//
/** 克隆组件 */
const handleCloneComponent = (component: DiyComponent<any>) => {
const instance = cloneDeep(component);
instance.uid = Date.now();

View File

@ -595,18 +595,22 @@ $phone-width: 375px;
}
/* 手机页面编辑区域 */
.phone-container {
position: relative;
width: $phone-width;
height: 100%;
margin: 0 auto;
overflow-x: hidden;
background-repeat: no-repeat;
background-size: 100% 100%;
:deep(.editor-design-center) {
width: 100%;
.drag-area {
width: 100%;
/* 主体内容 */
.phone-container {
position: relative;
width: $phone-width;
height: 100%;
margin: 0 auto;
background-repeat: no-repeat;
background-size: 100% 100%;
.drag-area {
width: 100%;
height: 100%;
}
}
}