File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/vue-kit/src/composables Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { onBeforeUnmount , onMounted , shallowRef } from 'vue'
2
+ import type { EditorOptions } from '@tiptap/vue-3'
2
3
import { Editor } from '@tiptap/vue-3'
3
4
import type { SetupKitOptions } from '../setupKit'
4
5
import { setupKit } from '../setupKit'
@@ -7,15 +8,14 @@ export interface UseNoteEditorOptions {
7
8
kitOptions : SetupKitOptions
8
9
}
9
10
10
- export function useNoteEditor ( options ?: Partial < UseNoteEditorOptions > ) {
11
+ export function useNoteEditor ( editorOptions ?: Partial < EditorOptions > , kitOptions ?: Partial < SetupKitOptions > ) {
11
12
const editor = shallowRef < Editor > ( )
12
13
13
14
onMounted ( ( ) => {
14
15
editor . value = new Editor ( {
15
16
content : 'Note editor' ,
16
- extensions : [
17
- options ?. kitOptions ? setupKit . configure ( options ?. kitOptions ) : setupKit ,
18
- ] ,
17
+ ...editorOptions ,
18
+ extensions : [ ...( editorOptions ?. extensions ?? [ ] ) , kitOptions ? setupKit . configure ( kitOptions ) : setupKit ] ,
19
19
} )
20
20
} )
21
21
onBeforeUnmount ( ( ) => {
You can’t perform that action at this time.
0 commit comments