wangeditor设置字体_vue 中使用wangeditor 配置字号,无效果

配置字号的时候,按照官网说的,但是就没有效果 , 但是自定义字体都可以,有效果

大佬们江湖救急~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'

];

打印也能看到

1b3a3168b8b86c2b7e7b2fbac069592b.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值