const katex = require('katex'); const win: any = window; win.katex = katex;
首先,引入katexcss
@import '~katex/dist/katex.css';
而後,引入katex.csside
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'] ] } } };
最後,配置editorui