Add option to show editor by default while still having the option to show preview

This commit is contained in:
kolaente 2020-07-14 20:29:32 +02:00
parent e945c663b4
commit 06f055a251
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 10 additions and 3 deletions

View File

@ -54,6 +54,10 @@
type: Boolean,
default: true,
},
previewIsDefault: {
type: Boolean,
default: true,
},
},
data() {
return {
@ -210,8 +214,11 @@
},
beforeMount() {
this.text = this.value
if (this.hasPreview) {
this.$nextTick(this.renderPreview)
if (this.previewIsDefault) {
if (this.hasPreview) {
this.$nextTick(this.renderPreview)
}
return
}

View File

@ -58,7 +58,7 @@
<editor
placeholder="Label description"
v-model="labelEditLabel.description"
@change="editLabelSubmit"
:preview-is-default="false"
/>
</div>
</div>