mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-21 00:13:58 +08:00
simplify placeholder example
This commit is contained in:
parent
cf7ff907a1
commit
1b5b60c595
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<input type="text" v-model="placeholder">
|
<input type="text" v-model="editor.extensions.options.placeholder.emptyNodeText">
|
||||||
<editor-content class="editor__content" :editor="editor" />
|
<editor-content class="editor__content" :editor="editor" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -19,7 +19,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
placeholder: 'Write something …',
|
|
||||||
editor: new Editor({
|
editor: new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
new BulletList(),
|
new BulletList(),
|
||||||
@ -36,11 +35,6 @@ export default {
|
|||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.editor.destroy()
|
this.editor.destroy()
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
placeholder(newValue) {
|
|
||||||
this.editor.extensions.options.placeholder.emptyNodeText = newValue
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user