From c4b40dea79bd8f689434f165c47daf831761ff83 Mon Sep 17 00:00:00 2001 From: khj0414 Date: Fri, 4 Apr 2025 16:18:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=A9=EC=96=B4=EC=A7=91=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=82=AC=ED=95=AD=20=EC=97=86=EC=9D=84=EB=96=84=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/wordDict/DictWrite.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/wordDict/DictWrite.vue b/src/components/wordDict/DictWrite.vue index 4913467..e37b52d 100644 --- a/src/components/wordDict/DictWrite.vue +++ b/src/components/wordDict/DictWrite.vue @@ -51,7 +51,7 @@
-
@@ -150,6 +150,16 @@ const ValidHandler = (field) => { } const handleContentUpdate = (newContent) => { content.value = newContent; + + const oldContent = typeof props.contentValue === 'string'? JSON.parse(props.contentValue) : props.contentValue; + const newContentOps = newContent?.ops || []; + + const oldContentJson = JSON.stringify(oldContent); + const newContentJson = JSON.stringify(newContentOps); + + // 기존 데이터와 새 데이터가 다를 경우 changed = true; + changed.value = oldContentJson !== newContentJson; + ValidHandler("content"); // 유효성 검사 실행 };