tiptap/packages/core/src/extensions/editable.ts

18 lines
368 B
TypeScript
Raw Normal View History

2020-11-03 05:43:54 +08:00
import { Plugin, PluginKey } from 'prosemirror-state'
2020-11-16 06:25:25 +08:00
import { Extension } from '../Extension'
2020-11-03 05:43:54 +08:00
2020-11-16 06:25:25 +08:00
export const Editable = Extension.create({
2020-12-02 16:44:46 +08:00
name: 'editable',
2020-11-03 05:43:54 +08:00
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('editable'),
props: {
editable: () => this.editor.options.editable,
},
}),
]
},
})