Use watch to change localDescription
This commit is contained in:
parent
08c9aa4bf3
commit
8c7f4ab481
|
@ -129,6 +129,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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 }"
|
||||||
>
|
>
|
||||||
|
@ -257,7 +257,7 @@
|
||||||
@keydown.enter.prevent=""
|
@keydown.enter.prevent=""
|
||||||
>
|
>
|
||||||
<p v-else>
|
<p v-else>
|
||||||
{{ attachment.description }}
|
{{ localDescription }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue