<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                #### rich-text > 基礎庫 1.4.0 開始支持,低版本需做[兼容處理](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) 富文本。 | 屬性 | 類型 | 默認值 | 說明 | 最低版本 | | ----- | -------------- | ---- | ------------------ | ---------------------------------------- | | nodes | Array / String | [] | 節點列表 / HTML String | [1.4.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | 支持默認事件,包括:`tap`、`touchstart`、`touchmove`、`touchcancel`、`touchend`和`longtap` **nodes 屬性推薦使用 Array 類型,由于組件會將 String 類型轉換為 Array 類型,因而性能會有所下降** ##### nodes 現支持兩種節點,通過type來區分,分別是元素節點和文本節點,默認是元素節點,在富文本區域里顯示的HTML節點 **元素節點:type = node** | 屬性 | 說明 | 類型 | 必填 | 備注 | | -------- | ----- | ------ | ---- | ---------------------- | | name | 標簽名 | String | 是 | 支持部分受信任的HTML節點 | | attrs | 屬性 | Object | 否 | 支持部分受信任的屬性,遵循Pascal命名法 | | children | 子節點列表 | Array | 否 | 結構和nodes一致 | **文本節點:type = text** | 屬性 | 說明 | 類型 | 必填 | 備注 | | ---- | ---- | ------ | ---- | ---------- | | text | 文本 | String | 是 | 支持entities | ##### 受信任的HTML節點及屬性 全局支持class和style屬性,**不支持id屬性**。 | 節點 | 屬性 | | ---------- | ---------------------------- | | a | | | abbr | | | b | | | blockquote | | | br | | | code | | | col | span,width | | colgroup | span,width | | dd | | | del | | | div | | | dl | | | dt | | | em | | | fieldset | | | h1 | | | h2 | | | h3 | | | h4 | | | h5 | | | h6 | | | hr | | | i | | | img | alt,src,height,width | | ins | | | label | | | legend | | | li | | | ol | start,type | | p | | | q | | | span | | | strong | | | sub | | | sup | | | table | width | | tbody | | | td | colspan,height,rowspan,width | | tfoot | | | th | colspan,height,rowspan,width | | thead | | | tr | | | ul | | **示例:** ``` <!-- rich-text.wxml --> <rich-text nodes="{{nodes}}" bindtap="tap"></rich-text> ``` ``` // rich-text.js Page({ data: { nodes: [{ name: 'div', attrs: { class: 'div_class', style: 'line-height: 60px; color: red;' }, children: [{ type: 'text', text: 'Hello&nbsp;World!' }] }] }, tap() { console.log('tap') } }) ``` ##### 注意事項 1. `tip`: nodes 不推薦使用 String 類型,性能會有所下降。 2. `tip`: `rich-text` 組件內屏蔽所有節點的事件。 3. `tip`: attrs 屬性不支持 id ,支持 class 。 4. `tip`: name 屬性大小寫不敏感。 5. `tip`: 如果使用了不受信任的HTML節點,該節點及其所有子節點將會被移除。 6. `tip`: img 標簽僅支持網絡圖片。 7. `tip`: 如果在自定義組件中使用 `rich-text` 組件,那么僅自定義組件的 wxss 樣式對 `rich-text` 中的 class 生效。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看