Skip to content

Commit

Permalink
添加自定义尺寸和选择预设尺寸
Browse files Browse the repository at this point in the history
  • Loading branch information
isDeje committed Jun 23, 2024
1 parent d0c0f43 commit c5bf71d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/index/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ const computeWH = function(w, h, box_width, box_height) {
wS.value = `${box_height * scale}px`; // 计算宽
hS.value = `min-height: ${box_height}px`; // 计算高
} else {
console.log(scale);
console.log(box_width / (box_width / scale));
wS.value = `${box_width}px`;
hS.value = `height: ${box_width / scale}px`;
Expand Down Expand Up @@ -654,6 +651,10 @@ const richTextInput = () => {
console.log(topRef.value.clientWidth);
// 根据元素的尺寸变化更新状态或执行其他逻辑
setTimeout(() => {
if(sizeValue.value < 0){
computeWH(customW.value, customH.value, topRef.value.clientWidth, topRef.value.clientHeight );
return;
}
computeWH(sizeList.value[sizeValue.value].w, sizeList.value[sizeValue.value].h, topRef.value.clientWidth, topRef.value.clientHeight );
}, 300);
}
Expand Down

0 comments on commit c5bf71d

Please sign in to comment.