const katex = require('katex'); const win: any = window; win.katex = katex;
首先,引入katex
@import '~katex/dist/katex.css';
然后,引入katex.css
editorConfig = { placeholder: '文档详情', modules: { formula: true, toolbar: { container: [ [{ header: [1, 2, 3, false] }], ['bold', 'italic', 'underline'], [{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'color': [] }, { 'background': [] }], [{ 'font': [] }, { 'align': [] }], ['blockquote', 'code-block', 'formula', 'image', 'video'], ['activity'] ] } } };
最后,配置editor