Skip to content

Commit 2197e0b

Browse files
committed
Fix preview not updating when navigating through a structure field. Closes #6
1 parent dda2449 commit 2197e0b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/embedField.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ export default {
4747
this.media = this.value.media
4848
}
4949
},
50+
watch: {
51+
inputValue() {
52+
if(this.value && this.value.media && this.hasLength(this.value.media)) {
53+
this.media = this.value.media
54+
}
55+
else {
56+
this.media = {}
57+
}
58+
}
59+
},
5060
computed: {
5161
hasMedia() {
5262
return this.hasLength(this.media) && this.media.code

0 commit comments

Comments
 (0)