rich-text 的nodes 该怎么书写
看了文档 一头雾水,需要一个 正确的 nodes 的 格式。
如: 小明 回复 煞笔:你在干什么?
*如果我不使用 html标签形式,直接通过 官方文档上 nodes 的编写格式该怎么写
nodes: [{ name: 'div', attrs: { class: 'div_class', style: 'line-height: 60px; color: red;' }, children: [{ type: 'text', text: 'Hello World!' }] }] |
参照以上的 结构形式 该怎么写。
**反正我是按照文档描述没写出来,以下贴出我写的吧,跪求大佬指点。。。
nodes: [{ name: 'div', attrs: { class: 'div_class', style: 'line-height: 60px; color: red;' }, children: [{ type: 'text', text: '小明', attrs: { class: 'div_class', style: 'line-height: 60px; color: red;' } }, { type:'text', text:'回复', attrs: { class: 'div_class', style: 'line-height: 60px; color: black;' } }, { type:'text', text:'煞笔', attrs: { class: 'div_class', style: 'line-height: 60px; color: red;' } }, { type:'text', text:'你在干什么', attrs: { class: 'div_class', style: 'line-height: 60px; color: black;' } } ] }] |
