JS获取富文本中的图片地址

   getImgList(str) {
      var list = [];
      str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g,    
      function(
        match,
        capture
      ) {
        list.push(capture);
      });
      return list;
    }

评论

暂无评论