Skip to content

Open source personal finance application

fix(description): replace onMounted with watch for better reactivity in description handling

Ilya Komichevfe5b6fa3fa87
diff --git a/app/components/trnForm/main/Description.vue b/app/components/trnForm/main/Description.vue
index cbbb5756..bfdb5f2f 100644
--- a/app/components/trnForm/main/Description.vue
+++ b/app/components/trnForm/main/Description.vue
@@ -5,7 +5,13 @@ const { t } = useI18n()
const trnsFormStore = useTrnsFormStore()
const desc = ref('')
-onMounted(() => desc.value = trnsFormStore.values.desc ?? '')
+watch(
+ () => trnsFormStore.values.desc,
+ (value) => {
+ desc.value = value ?? ''
+ },
+ { immediate: true },
+)
function onSave(close: () => void) {
trnsFormStore.values.desc = desc.value
diff --git a/app/components/trnForm/types.ts b/app/components/trnForm/types.ts
index 2aeb82cc..0ba4f8c3 100644
--- a/app/components/trnForm/types.ts
+++ b/app/components/trnForm/types.ts
@@ -1,4 +1,5 @@
export type TrnFormUi = {
+ catsRootModal: boolean
isShow: boolean
walletsModal: boolean
}