UNPKG

vue-admin-core

Version:
1 lines 1.06 kB
{"version":3,"file":"elem-to-html.mjs","sources":["../../../../../../package/components/msg-editor/src/elem-to-html.ts"],"sourcesContent":["/**\n * @description elem to html\n * @author wangfupeng\n */\n\nimport { SlateElement } from \"@wangeditor/editor\";\nimport { VariableElement } from \"./types\";\n\n// 生成 html 的函数\nfunction variableToHtml(elem: SlateElement): string {\n const { value = \"\", label = \"\" } = elem as VariableElement;\n return `<span data-w-e-type=\"variable\" data-w-e-is-void data-w-e-is-inline data-value=\"${value}\" data-label=\"${label}\">${label}</span>`;\n}\n\n// 配置\nconst conf = {\n type: \"variable\", // 节点 type ,重要!!!\n elemToHtml: variableToHtml\n};\n\nexport default conf;\n"],"names":[],"mappings":"AASA,SAAS,eAAe,IAA4B,EAAA;AAClD,EAAA,MAAM,EAAE,KAAA,GAAQ,EAAI,EAAA,KAAA,GAAQ,IAAO,GAAA,IAAA,CAAA;AACnC,EAAA,OAAO,CAAkF,+EAAA,EAAA,KAAK,CAAiB,cAAA,EAAA,KAAK,KAAK,KAAK,CAAA,OAAA,CAAA,CAAA;AAChI,CAAA;AAGA,MAAM,IAAO,GAAA;AAAA,EACX,IAAM,EAAA,UAAA;AAAA;AAAA,EACN,UAAY,EAAA,cAAA;AACd;;;;"}