[渲染层错误] [Component] <rich-text>: parse error TypeError: Cannot read property 'replace' of null(env: Windows,mp,1.06.2402040; lib: 3.4.7)
<rich-text :nodes="nodes"></rich-text>
export default {
data() {
return {
nodes:null
}
}
}
onLoad() {
this.nodes= [{"name":"p","attrs":{"style":"margin:5px 5px;font-size:15px;line-height:1.75;letter-spacing:0.2em;word-spacing:0.1em"},"children":[{"type":"text","text":"排序算法:"}]},{"name":"p","attrs":{"style":"margin:5px 5px;font-size:15px;line-height:1.75;letter-spacing:0.2em;word-spacing:0.1em"},"children":[{"type":"text","text":"``"}]}]
setTimeout(()=>{
this.nodes = [{"name":"p","attrs":{"style":"margin:5px 5px;font-size:15px;line-height:1.75;letter-spacing:0.2em;word-spacing:0.1em"},"type":"node","children":[{"type":"text","text":"排序算法:"}]},{"name":"div","attrs":{"class":"hl-pre","style":"border-radius:5px;white-space:pre;background:#2d2d2d;font-size:12px;position:relative;user-select:none","data-content":"\n"},"type":"node","children":[{"name":"code","attrs":{"class":"hl-code","style":"display:block;overflow: auto;"},"type":"node","children":[{"name":"div","attrs":{"class":"markdown-wrap"},"type":"node","children":[{"name":"div","attrs":{"class":"hljs","style":"border-radius:5px;white-space:pre;background:#2d2d2d;font-size:12px;position:relative;padding:10px 8px 0;margin-bottom:5px;overflow:auto;display:block"},"type":"node","children":[{"name":"code","attrs":{},"type":"node","children":[{"name":"ol","attrs":{"style":"margin:5px 5px;font-size:15px;padding:0px 30px"},"type":"node","children":[{"type":"text","text":"text "}]}]}]}]}]},{"name":"div","attrs":{"class":"hl-language","style":"user-select:none;position:absolute;top:3px;right:3px;font-size:10px;"},"children":[{"type":"text","text":"text "}]},{"name":"div","attrs":{"class":"hl-copy","style":"user-select:none;position:absolute;top:0;right:3px;font-size:10px;"}}]}]
},1000)
}
真机可以复现么,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
请问问题解决了吗?3.4.7 以后rich-text 另一个问题 https://developers.weixin.qq.com/community/develop/doc/000c0c102982f84c2ed16846a61400
确实是有bug 当text:null的时候就会出现,3.4.6正常,3.4.7的灰度有这个问题,希望排查一下