wangEditor 设置字体大小16px、字体微软雅黑、行高1.5文章来源:https://www.toymoban.com/news/detail-549889.html
const editor = createEditor({
selector: '#editor-container',
html: '<p></p>',
content: [
{
type: 'paragraph',
children: [
{ text: '', fontFamily: '微软雅黑', fontSize: '16px'}
],
lineHeight: 1.5
},
],
config: editorConfig,
mode: 'default', // or 'simple'
})
wangEditor 配置完整代码文章来源地址https://www.toymoban.com/news/detail-549889.html
const { createEditor, createToolbar } = window.wangEditor
const editorConfig = {
placeholder: '请输入正文...',
onChange(editor) {
const html = editor.getHtml()
//console.log(html)
_v_this.dataFrom.infor_content = html
// 也可以同步到 <textarea>
}
}
const editor = createEditor({
selector: '#editor-container',
html: '<p></p>',
content: [
{
type: 'paragraph',
children: [
{ text: '', fontFamily: '微软雅黑', fontSize: '16px'}
],
lineHeight: 1.5
},
],
config: editorConfig,
mode: 'default', // or 'simple'
})
const toolbarConfig = {}
const toolbar = createToolbar({
editor,
selector: '#toolbar-container',
config: toolbarConfig,
mode: 'default', // or 'simple'
})
到了这里,关于wangEditor 初始化设置行高、字体和字体大小的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!