fix: prevent view update (#1102)

This commit is contained in:
Jonas Plum
2024-09-20 00:02:15 +02:00
committed by GitHub
parent 6346140de5
commit ea03a3ed23
3 changed files with 8 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import {
SelectValue
} from '@/components/ui/select'
import isEqual from 'lodash.isequal'
import { onMounted, ref, watch } from 'vue'
import type { JSONSchema } from '@/lib/types'
@@ -34,6 +35,11 @@ onMounted(() => {
watch(
() => formdata.value,
() => {
const normFormdata = JSON.parse(JSON.stringify(formdata.value))
const normModel = JSON.parse(JSON.stringify(model.value))
if (isEqual(normFormdata, normModel)) return
model.value = { ...formdata.value }
},
{ deep: true }