拼接字串時,\r\n
被轉義成換行導致出錯,不想讓它轉義的方法就是把\r\n
替換成空
res.data.forEach(m => {
m = m.replace(/[\r\n]/g, '');
this.richText = this.richText + "<img src=\"data:image/jpeg;base64," + m + "\">";
})
複製程式碼
\r\n
被轉義成換行導致出錯,不想讓它轉義的方法就是把\r\n
替換成空
res.data.forEach(m => {
m = m.replace(/[\r\n]/g, '');
this.richText = this.richText + "<img src=\"data:image/jpeg;base64," + m + "\">";
})
複製程式碼