refactoring

This commit is contained in:
Philipp Kühn
2020-10-27 22:35:31 +01:00
parent d8e82959ec
commit a731ff8ea2
3 changed files with 19 additions and 65 deletions

View File

@@ -1,5 +1,8 @@
<template>
<div v-if="editor">
<button @click="addImage">
image
</button>
<editor-content :editor="editor" />
</div>
</template>
@@ -23,6 +26,14 @@ export default {
}
},
methods: {
addImage() {
const url = window.prompt('URL')
this.editor.chain().focus().image({ src: url }).run()
},
},
mounted() {
this.editor = new Editor({
extensions: [

View File

@@ -110,7 +110,7 @@ code {
}
img {
width: 100%;
max-width: 100%;
height: auto;
}