add link commands

This commit is contained in:
Philipp Kühn
2020-11-18 11:10:06 +01:00
parent 9d99e9c9d0
commit 56c8bb1bd0
3 changed files with 19 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
<button @click="addLink" :class="{ 'is-active': editor.isActive('link') }">
link
</button>
<button @click="editor.chain().focus().removeMark('link').run()" v-if="editor.isActive('link')">
<button @click="editor.chain().focus().removeLink().run()" v-if="editor.isActive('link')">
remove
</button>
<editor-content :editor="editor" />
@@ -52,7 +52,7 @@ export default {
addLink() {
const url = window.prompt('URL')
this.editor.chain().focus().link({ href: url }).run()
this.editor.chain().focus().addLink({ href: url }).run()
},
},