初始化tinymce时重新定义格式样式

初始化tinymce时重新定义格式样式,tinymce,tinymce-4,Tinymce,Tinymce 4,这就是我添加tinymce init代码之前tinymce的样子 这就是上面代码之后的样子: 如何在不丢失所有界面按钮的情况下仍保留style_格式。我劝他们留下来/ 感谢您所做的一切-您重新定义了工具栏属性,默认情况下该属性类似于:撤消重做|样式选择|粗体斜体|对齐左对齐中心对齐右对齐调整| bullist numlist outdent缩进,只需一个样式选择。考虑将StultRead插入默认值,而 tinymce.init{ 选择器:“textarea”,//根据html更改此值 工具栏:

这就是我添加tinymce init代码之前tinymce的样子

这就是上面代码之后的样子:

如何在不丢失所有界面按钮的情况下仍保留style_格式。我劝他们留下来/


感谢您所做的一切-您重新定义了工具栏属性,默认情况下该属性类似于:撤消重做|样式选择|粗体斜体|对齐左对齐中心对齐右对齐调整| bullist numlist outdent缩进,只需一个样式选择。考虑将StultRead插入默认值,而

tinymce.init{ 选择器:“textarea”,//根据html更改此值 工具栏:撤消重做|样式选择|粗体斜体|对齐左对齐中心对齐右对齐对齐对齐对齐|粗体numlist outdent缩进, 样式和格式:[ {title:'main title',inline:'span',style:{'text-decoration':'underline','text-decoration-color':'f00',color:'000','font-size':'26px','font-weight':'700','display':'inline block','margin bottom':'55px','text-align':'center','width':'100%}, {标题:“粗体文本”,内联:“b'}, {title:'Red text',inline:'span',style:{color:'ff0000'}, {title:'Red header',block:'h1',style:{color:'ff0000'}, {标题:'Cowanbanga',内联:'span',类:'example1'}, {title:'example2',inline:'span',classes:'example2'}, {title:'表格样式'}, {title:'Table row 1',选择器:'tr',类:'tablerow 1'} ] };
            tinymce.init({
              selector: 'textarea',  // change this value according to your html
              toolbar: "styleselect",
              style_formats: [
                {title: 'main title', inline: 'span', styles: {'text-decoration':'underline','text-decoration-color':'#f00', color: '#000','font-size': '26px','font-weight' : '700', 'display': 'inline-block', 'margin-bottom': '55px','text-align':'center','width':'100%'}},
                {title: 'Bold text', inline: 'b'},
                {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
                {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
                {title: 'Cowanbanga', inline: 'span', classes: 'example1'},
                {title: 'Example 2', inline: 'span', classes: 'example2'},
                {title: 'Table styles'},
                {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
              ]
            });