@@ -293,6 +293,8 @@ const dragEndHandle = (item: any, index: number) => {
// {x: number, y: number, w: number, h: number}
const resizingHandle = (new_location: any, key: string, index: number) => {
const { x, y, w, h } = new_location;
+ console.log(new_location);
+
diy_data.value[index].location = { x, y, record_x: x, record_y: y, staging_y: y };
const com_data = diy_data.value[index].com_data;
com_data.com_width = w;
@@ -310,10 +312,10 @@ const resizingHandle = (new_location: any, key: string, index: number) => {
};
// 图片大小的计算
const handleImg = (com_data: any, w: number, h: number ) => {
- if (com_data.border_show) {
+ if (com_data.border_show == '1') {
return { img_width: w - com_data.border_size * 2, img_height: h - com_data.border_size * 2 }
} else {
- return { img_width: w, img_height: h }
+ return { img_width: w, img_height: h }
}
};
// 线条的计算
@@ -657,10 +659,8 @@ defineExpose({
background: #fff;
margin: 0 auto;
.drag-area {
- height: calc(v-bind(drag_area_height) + 0.4rem);
- width: calc(100% + 0.4rem);
- left: -0.2rem;
- bottom: -0.2rem;
+ height: v-bind(drag_area_height);
+ width: 100%;
margin: 0.5rem 0; // 用于将上边框和下边框显示出来
user-select: none;
cursor: crosshair;