refactor style, fix #77 #76

This commit is contained in:
les
2020-06-22 19:15:32 +02:00
parent eab90627a3
commit 3f1bf4cc4a
8 changed files with 152 additions and 72 deletions

View File

@@ -38,7 +38,7 @@
</template>
<script>
import _ from 'lodash'
import { Editor, EditorContent, EditorMenuBar, EditorMenuBubble } from 'tiptap'
import { Editor, EditorContent, EditorMenuBar, EditorMenuBubble, Extension } from 'tiptap'
import {
Blockquote,
BulletList,
@@ -101,7 +101,21 @@ export default {
new Bold(),
new Italic(),
new Strike(),
new Underline()
new Underline(),
new class extends Extension {
keys () {
return {
Enter (state, dispatch, view) {
const { schema, doc, tr } = view.state
const hard_break = schema.nodes.hard_break
const transaction = tr.replaceSelectionWith(hard_break.create()).scrollIntoView()
view.dispatch(transaction)
return true
}
}
}
}()
]
})
},