changed placeholder example for reactive placeholder
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="editor">
|
||||
<input type="text" v-model="placeholder">
|
||||
<editor-content class="editor__content" :editor="editor" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -18,6 +19,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
placeholder: 'Write something …',
|
||||
editor: new Editor({
|
||||
extensions: [
|
||||
new BulletList(),
|
||||
@@ -34,6 +36,11 @@ export default {
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
},
|
||||
watch: {
|
||||
placeholder(newValue) {
|
||||
this.editor.extensions.options.placeholder.emptyNodeText = newValue
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user