Taro3不使用wxParse渲染富文字

2021-10-09 16:52:34 字數 453 閱讀 1361

taro 可以不使用wxparse直接通過 element#innerhtml 或 vue 的 v-html 或 react/nerv 的 dangerouslysetinnerhtml 直接渲染 html

詳細請看 這裡

但是有幾個問題需要注意

1、頁面重新render的時候dangerouslysetinnerhtml好像不會更新,如果一開始是空字串的話可能會出現資料富文字渲染不出來的情況

2、如果富文字裡面有,渲染出來的mode是scaletofill,但這往往不符合我們的要求,可以使用taro.options.html.transformelement修改

// 修改所有 img 標籤的mode屬性

taro.options.html.transformelement = (el) =>

return el

}

記錄 taro3 的坑

dependencies devdependencies 具體報錯 vm33 waservice.js 2 miniprogramerror missing after argument list syntaxerror missing after argument list頁面 pages me ...

W3 Jmail 使用範例

confirmation set jmail server.createobject jmail.tpmail this is my local tp server jmail.serveraddress mail.yourdomain.25 this is me.jmail.sender myem...

人們為什麼不使用Python3?

關於python 3 python 社群的朋友和開發者們,咱們一起聊聊python3吧。python3在2008年12月3日首次發布。當時廣泛的說法是 程式設計師接受python3將是乙個漫長的過程,這個過程被預期為五年。現在,我們剛剛度過了這個標誌性的5年。在python 3發布起初以及隨後的幾年...