@@ -69,6 +69,9 @@ function initState() {
6969 stateRef .value = DomainState .fromJSON (JSON .stringify (data), apiRef .value , {
7070 isNew: isNewMode .value ,
7171 })
72+ // DEBUG
73+ stateRef .value ._isNew = isNewMode .value ;
74+ // console.debug("[initState()] stateRef.value._isNew = ", stateRef.value._isNew);
7275 Object .assign (form, stateRef .value ._getTarget ())
7376 unsub = stateRef .value .subscribe (syncDisplay)
7477 syncDisplay ()
@@ -134,10 +137,15 @@ function doReset() {
134137
135138function toggleMode () {
136139 isNewMode .value = ! isNewMode .value
140+ stateRef .value ._isNew = isNewMode .value ;
141+ // DEBUG
142+ // console.debug("stateRef.value._isNew = ", stateRef.value._isNew);
137143 initState ()
138144}
139145
140146const predicted = computed (() => {
147+ // DEBUG
148+ // console.debug("[predicted] stateRef.value._isNew = ", stateRef.value._isNew);
141149 if (display .isNew ) return ' POST'
142150 if (display .dirtyFields .length === 0 ) return ' PUT'
143151 if (display .dirtyRatio >= 0.7 ) return ' PUT'
@@ -174,7 +182,7 @@ const reasonText = computed(() => {
174182 < span class = " pg-label" > 도메인 데이터< / span>
175183 < div class = " pg-toggle" >
176184 < button : class = " ['tgl-btn', !isNewMode && 'on']" @click= " isNewMode && toggleMode()" > 기존 (fromJSON)< / button>
177- < button : class = " ['tgl-btn', isNewMode && 'on']" @click= " !isNewMode && toggleMode()" > 신규 (fromVO )< / button>
185+ < button : class = " ['tgl-btn', isNewMode && 'on']" @click= " !isNewMode && toggleMode()" > 신규 (_isNew )< / button>
178186 < / div>
179187 < / div>
180188
0 commit comments