add editable toggle to examples

This commit is contained in:
Philipp Kühn
2018-12-19 23:00:13 +01:00
parent 02ff0034c1
commit 1b5b0c6903

View File

@@ -1,5 +1,10 @@
<template> <template>
<div class="editor"> <div class="editor">
<div class="checkbox">
<input type="checkbox" id="editable" v-model="editable" />
<label for="editable">editable</label>
</div>
<editor-content class="editor__content" :editor="editor" /> <editor-content class="editor__content" :editor="editor" />
</div> </div>
</template> </template>
@@ -40,10 +45,24 @@ export default {
</p> </p>
`, `,
}), }),
editable: false,
} }
}, },
watch: {
editable() {
this.editor.setOptions({
editable: this.editable,
})
},
},
beforeDestroy() { beforeDestroy() {
this.editor.destroy() this.editor.destroy()
}, },
} }
</script> </script>
<style lang="scss">
.checkbox {
margin-bottom: 1rem;
}
</style>