Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

配置字号的时候,按照官网说的,但是就没有效果 , 但是自定义字体都可以,有效果
大佬们江湖救急~

   this.editor = new E(this.$refs.toolbar, this.$refs.editor);
   this.editor.customConfig.onchange = (html) => {
   this.isChange = true;
   this.$emit("update:contentDefault", html); // 把这个html传入父组件
        };
  this.editor.customConfig.menus = [
          "head", // 标题
          "bold", // 粗体
          "fontSize", // 字号
          "fontName", // 字体
          "italic", // 斜体
          "underline", // 下划线
          "strikeThrough", // 删除线
          "foreColor", // 文字颜色
          "backColor", // 背景颜色
          "link", // 插入链接
          "list", // 列表
          "justify", // 对齐方式
          "image", // 插入图片
          "video", // 插入视频
          "quote", // 引用
          "table", // 表格
          "code", // 插入代码
          "undo", // 撤销
          "redo", // 重复
        ];
        this.editor.customConfig.fontSizes = {
          'x-small': {
            name: '10px',
            value: '1',
          },
          small: {
            name: '13px',
            value: '2',
          },
          normal: {
            name: '16px',
            value: '3',
          },
          large: {
            name: '18px',
            value: '4',
          },
          'x-large': {
            name: '24px',
            value: '5',
          },
          'xx-large': {
            name: '32px',
            value: '6',
          },
        };

        // 自定义字体
        this.editor.customConfig.fontNames = [
          '宋体',
          '仿宋',
          '微软雅黑',
          'Arial',
          'Tahoma',
          'Verdana'
        ];

打印也能看到
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

版本的问题 , v4版本才可以改字号 ,我安装的是v3


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...