getImgSrc(richtext) {
let imgList = [];
richtext.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, (match, capture) => {
imgList.push(capture);
});
return imgList;
}
这个方法 拿过去用就是了
参数是后台返回给你得富文本内容 传入就可以了 ,就可以拿到图片。
getImgSrc(richtext) {
let imgList = [];
richtext.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, (match, capture) => {
imgList.push(capture);
});
return imgList;
}
这个方法 拿过去用就是了
参数是后台返回给你得富文本内容 传入就可以了 ,就可以拿到图片。