https://ext.dcloud.net.cn/plugin?id=263 使用这个,返回空数组,好无语,怎么解决
uniapp 支付宝小程序富文本,解决不支持String问题
https://blog.csdn.net/L630642270/article/details/100174595?utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~default-9.pc_relevant_baidujshouduan&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromBaidu~default-9.pc_relevant_baidujshouduan
uniapp支付宝小程序 富文本处理
https://blog.csdn.net/weixin_42448623/article/details/114676455?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-baidujs-2.nonecase
import parse from "@/node_modules/mini-html-parser2"
export function zfbRichText(htmStr){
return new Promise((resolve, reject)=>{
parse(htmStr, (err, htmlNodes) => {
if(!err) {
resolve(htmlNodes);
}
})
})
}
// #ifdef MP-ALIPAY
let html = '<div style="text-align:center;">12312313<span style="color:red">222</span></div>'
var brs = html.replace(/<br[^>]*>/gi, '<br/>').replace(/<img[^>]*>/gi, $ => $.replace(/>/gi,'\/>'));
zfbRichText(brs).then(res=>{_this.nodes = res})
// #endif
0 个回复