代码改变世界

Quill Editor使用公式

2018-12-12 10:17  slmk  阅读(2378)  评论(1编辑  收藏  举报
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