字节跳动小程序开发组件文档 rich-text

2019-08-07 09:57 更新

富文本。

属性名 类型 默认值 说明 最低版本
nodes Array/String [ ] 节点列表 / HTML String 1.0.0

WARNING

nodes 属性推荐使用 Array 类型,由于组件会将 String 类型转换为 Array 类型,因而性能会有所下降

示例


开发者工具中预览

<rich-text nodes="{{nodes}}"></rich-text>
Page({
  data: {
    nodes: [{
      name: 'div',
      attrs: {
        class: 'div_class',
        style: 'line-height: 60px; color: red;'
      },
      children: [{
        type: 'text',
        text: 'Hello&nbsp;World!'
      }]
    }]
  }
})


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号