feat: 通过wangeditor自定义打印模板

This commit is contained in:
Lesan
2025-08-29 14:19:52 +08:00
parent 97e538539e
commit 84de7fcd46
13 changed files with 482 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import { DOMElement } from './utils/dom'
import { IDomEditor, SlateDescendant, SlateElement } from '@wangeditor/editor'
function parseHtml(
elem: DOMElement,
children: SlateDescendant[],
editor: IDomEditor
): SlateElement {
return {
type: 'process-record',
children: [{ text: '' }],
}
}
const parseHtmlConf = {
selector: 'span[data-w-e-type="process-record"]',
parseElemHtml: parseHtml,
}
export default parseHtmlConf