Use watch to change localDescription

This commit is contained in:
Sean King 2022-06-26 13:25:36 -06:00 committed by FloatingGhost
parent 7656486f19
commit bd5e868483
2 changed files with 6 additions and 3 deletions

View File

@ -132,6 +132,9 @@ const Attachment = {
...mapGetters(['mergedConfig']) ...mapGetters(['mergedConfig'])
}, },
watch: { watch: {
'attachment.description' (newVal) {
this.localDescription = newVal
},
localDescription (newVal) { localDescription (newVal) {
this.onEdit(newVal) this.onEdit(newVal)
} }

View File

@ -166,7 +166,7 @@
:icon="placeholderIconClass" :icon="placeholderIconClass"
/> />
<p> <p>
{{ edit ? localDescription : attachment.description }} {{ localDescription }}
</p> </p>
</a> </a>
@ -244,7 +244,7 @@
</span> </span>
</div> </div>
<div <div
v-if="size !== 'hide' && !hideDescription && (edit || (attachment.description && showDescription))" v-if="size !== 'hide' && !hideDescription && (edit || (localDescription && showDescription))"
class="description-container" class="description-container"
:class="{ '-static': !edit }" :class="{ '-static': !edit }"
> >
@ -259,7 +259,7 @@
@input="resize" @input="resize"
/> />
<p v-else> <p v-else>
{{ attachment.description }} {{ localDescription }}
</p> </p>
</div> </div>
</div> </div>