【发布时间】:2021-07-20 16:22:16
【问题描述】:
有没有办法在 tinymce 中创建和渲染列?例如,我想以某种方式插入
<div style={display:flex;}>
<div style={flex:50%;}>
<h2>Hello Earth!</h2>
</div>
<div style={flex:50%;}>
<h2>Hello Mars!</h2>
</div>
</div>
【问题讨论】:
标签: tinymce
有没有办法在 tinymce 中创建和渲染列?例如,我想以某种方式插入
<div style={display:flex;}>
<div style={flex:50%;}>
<h2>Hello Earth!</h2>
</div>
<div style={flex:50%;}>
<h2>Hello Mars!</h2>
</div>
</div>
【问题讨论】:
标签: tinymce
您不能使用方括号,但可以使用类创建模板
例子
templates: [
{"title":"2 rows","description":"Insert, 2 rows with the same width","content":"<article class=\"cmsblock\"><div class=\"col span_6\"><h2>Row 1</h2><p>row 1</p></div><div class=\"col span_6\"><h2>Row 2</h2><p>row 2</p></div></article><div class=\"clear\"> </div><p></p>"},
{"title":"3 rows","description":"Insert, 3 rows with the same width","content":"<article class=\"cmsblock\"><div class=\"col span_4\"><h2>Row 1</h2><p>row 1</p></div><div class=\"col span_4\"><h2>Row 2</h2><p>row 2</p></div><div class=\"col span_4\"><h2>Row 3</h2><p>row 3</p></div></article><div class=\"clear\"> </div><p></p>"}
],
【讨论】: