forked from yikoyu/vuetify-pro-tiptap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.ts
More file actions
23 lines (19 loc) · 647 Bytes
/
Copy pathcode.ts
File metadata and controls
23 lines (19 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import type { CodeOptions as TiptapCodeOptions } from '@tiptap/extension-code'
import type { GeneralOptions } from '@/type'
import { Code as TiptapCode } from '@tiptap/extension-code'
import { CodeActionButton } from './components/ActionButton'
export interface CodeOptions extends TiptapCodeOptions, GeneralOptions<CodeOptions> {}
export const Code = /* @__PURE__ */ TiptapCode.extend<CodeOptions>({
addOptions() {
return {
...this.parent?.() as TiptapCodeOptions,
button: ({ editor, t }) => ({
component: CodeActionButton,
componentProps: {
editor,
t,
},
}),
}
},
})