fix more commands
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.focus().undo()">
|
||||
<button @click="editor.chain().focus().undo().run()">
|
||||
undo
|
||||
</button>
|
||||
<button @click="editor.focus().redo()">
|
||||
<button @click="editor.chain().focus().redo().run()">
|
||||
redo
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<button @click="() => console.log(editor.focus())">focus</button>
|
||||
<button @click="() => console.log(editor.insertText('hello'))">insert</button>
|
||||
<button @click="editor.chain().focus().insertText('wat').insertHTML('<p>2</p>').run()">chain 1</button>
|
||||
<button @click="editor.chain().insertText('1').focus().run()">chain 2</button>
|
||||
<button @click="editor.chain().setContent('reset').insertText('1').clearContent().run()">setContent</button>
|
||||
<button @click="editor.chain().focus().deleteSelection().run()">deleteSelection</button>
|
||||
<editor-content :editor="editor" />
|
||||
</div>
|
||||
<editor-content :editor="editor" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -24,7 +16,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
console: console,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user