Skip to content

Commit

Permalink
feat: 清除水印
Browse files Browse the repository at this point in the history
  • Loading branch information
zjc2233 authored and Qiu-Jun committed Apr 20, 2024
1 parent 4132481 commit 96bd408
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/components/waterMark.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<Modal
v-model="showWaterMadal"
:title="$t('waterMark.modalTitle')"
:cancel-text="`${$t('cleanUp')}${$t('waterMark.text')}`"
@on-ok="onModalOk"
@on-cancel="onMadalCancel"
@on-cancel="onCleanUpWaterMark"
>
<div class="setting-item">
<span class="mr-10px">{{ $t('waterMark.setting.name') }}</span>
Expand Down Expand Up @@ -95,6 +96,12 @@ const onMadalCancel = () => {
waterMarkState.isRotate = 0;
};
const onCleanUpWaterMark = () => {
canvasEditor.canvas.overlayImage = null; // 清空覆盖层
canvasEditor.canvas.renderAll();
onMadalCancel();
};
const createCanvas = (width: number, height: number) => {
const waterCanvas = document.createElement('canvas');
waterCanvas.width = width;
Expand Down
3 changes: 2 additions & 1 deletion src/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,6 @@
"clearTip": "Are you sure you want to clear it?",
"replaceTip": "Are you sure you want to add to the canvas?",
"ok": "ok",
"cancel": "cancel"
"cancel": "cancel",
"cleanUp": "cleanUp"
}
3 changes: 2 additions & 1 deletion src/language/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,6 @@
"clearTip": "确定要清空吗?",
"replaceTip": "确定要添加到画布中吗?",
"ok": "确认",
"cancel": "取消"
"cancel": "取消",
"cleanUp": "清除"
}

0 comments on commit 96bd408

Please sign in to comment.