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