微信小程式使用的是
1.wxml 頁面元素的最簡單使用
<rich-text nodes="{{這是你的資料}}"></rich-text>
2. js部分
如下可以直接獲取
支付寶小程式
1.
axml 頁面簡單使用
<rich-text nodes="{{nodes}}" ></rich-text>
2. js部分
import parser from 'rich-text-parser' //這個檔案是參考是關鍵下載地址:https://github.com/Chaunjie/rich-text-parser
Page({
data: {
txte1: “”,
nodes: [],
},
onLoad(e) {
let that = this
let txte1 = e.txte
// const {p} = that.data
// 定義需要決議的特殊標簽,value不填默認是div
// parser.definedCustomTag({figure: 'p', figcaption: ''})
const nodes = parser.getRichTextJson(txte1)
that.setData({
nodes: nodes.children
})
},
});
這些資料我是上一個頁面傳遞新來的
首次記錄學習程序有不足之處請多見諒!!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/95279.html
標籤:Html/Css
上一篇:移動端rem適應布局
下一篇:CSS3 漸變
