微信小程序rich-text的使用方法
微信小程序 rich-text的使用方法
成都创新互联公司致力于互联网品牌建设与网络营销,包括成都网站制作、成都网站建设、外贸营销网站建设、SEO优化、网络推广、整站优化营销策划推广、电子商务、移动互联网营销等。成都创新互联公司为不同类型的客户提供良好的互联网应用定制及解决方案,成都创新互联公司核心团队十年专注互联网开发,积累了丰富的网站经验,为广大企业客户提供一站式企业网站建设服务,在网站建设行业内树立了良好口碑。
rich-text
- 属性:nodes 类型:Array / String 结点列表 / HTML String
- 全局支持class和style属性,不支持id属性。
- 结点类型:type = node , name 标签名 String 是 支持部分受信任的HTML结点, attrs 属性 Object 否 支持部分受信任的属性,遵循Pascal命名法 , children 子结点列表 Array 否 结构和nodes一致
- 结点类型:type = text ,text 文本 String 是 支持entities
- nodes 不推荐使用 String 类型,性能会有所下降
- rich-text 组件内屏蔽所有结点的事件。
- attrs 属性不支持 id ,支持 class 。
- name 属性大小写不敏感。
- 如果使用了不受信任的HTML结点,该结点及其所有子结点将会被移除。
- img 标签仅支持网络图片。

this.setData({
nodes: "html标题
",
nodes1: [{
name: "h2",
attrs: {
style: "color:red",
class: "red"
},
children: [{
type: "text",
text: '结点列表标题'
}]
}],
nodes2: [{
name: "ul",
attrs: {
style: "padding:20px;border:1px solid blue;",
class: "red"
},
children: [
{
name: "li",
attrs: {
style: "color:red",
class: "red"
},
children: [{
type: "text",
text: '多层结点 无序列表'
}],
}, {
name: "li",
attrs: {
style: "color:red",
class: "red"
},
children: [{
type: "text",
text: '多层结点 无序列表1'
}],
}]
}]
})
以上就是微信小程序 rich-text的介绍,如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
本文标题:微信小程序rich-text的使用方法
网页网址:http://www.jxjierui.cn/article/iidjsg.html


咨询
建站咨询
