feat: Reflect route change on stepper click, re-capture original form after section change to fix confirm dialog issue
This commit is contained in:
@@ -102,7 +102,8 @@ const isReadOnly = computed(() => {
|
||||
// Unsaved changes tracking
|
||||
const originalFormJson = ref<string>('')
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
originalFormJson.value = JSON.stringify(applicationForm.value)
|
||||
window.addEventListener('beforeunload', handleBeforeUnload)
|
||||
})
|
||||
@@ -161,6 +162,13 @@ watch(
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// Re-capture baseline after section navigation to absorb initialization effects
|
||||
// (e.g. TheTable applying row presets, TheEditor normalizing content on mount)
|
||||
watch(sectionIndex, async () => {
|
||||
await nextTick()
|
||||
originalFormJson.value = JSON.stringify(applicationForm.value)
|
||||
})
|
||||
|
||||
async function onSave() {
|
||||
if (applicationForm.value?.id) {
|
||||
const updated = await updateForm(applicationForm.value.id, applicationForm.value)
|
||||
|
||||
Reference in New Issue
Block a user