add basic node interface
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Command, Node } from '@tiptap/core'
|
||||
import { Command, Node, INode } from '@tiptap/core'
|
||||
import { DOMOutputSpecArray } from 'prosemirror-model'
|
||||
// import ParagraphComponent from './paragraph.vue'
|
||||
|
||||
// export type ParagraphCommand = () => Command
|
||||
@@ -28,7 +29,7 @@ import { Command, Node } from '@tiptap/core'
|
||||
// }))
|
||||
// .create()
|
||||
|
||||
export default class Paragraph extends Node {
|
||||
export default class Paragraph extends Node implements INode {
|
||||
|
||||
name = 'paragraph'
|
||||
|
||||
@@ -36,6 +37,15 @@ export default class Paragraph extends Node {
|
||||
|
||||
content = 'inline*'
|
||||
|
||||
createAttributes() {
|
||||
return {
|
||||
// default rendering
|
||||
class: {
|
||||
default: 'jooo',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
{ tag: 'p' },
|
||||
@@ -43,7 +53,7 @@ export default class Paragraph extends Node {
|
||||
}
|
||||
|
||||
renderHTML() {
|
||||
return ['p', 0]
|
||||
return ['p', 0] as const
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user