add editable toggle to examples
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user