소스 검색

处理富文本图片样式

sakura 1 년 전
부모
커밋
f128c8172d
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      pages/home/detail/detail.vue

+ 1 - 0
pages/home/detail/detail.vue

@@ -356,6 +356,7 @@
 					if (response && response.data) {
 					if (response && response.data) {
 						_this.eventsInfo = response.data; // 确保 response.data 存在
 						_this.eventsInfo = response.data; // 确保 response.data 存在
 						_this.eventsInfo.intro = he.decode(_this.eventsInfo.intro);
 						_this.eventsInfo.intro = he.decode(_this.eventsInfo.intro);
+						_this.eventsInfo.intro = response.data.intro.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ')
 						console.log(_this.eventsInfo); // 打印 eventsInfo 确认数据
 						console.log(_this.eventsInfo); // 打印 eventsInfo 确认数据
 					} else {
 					} else {
 						console.error('响应数据结构不符合预期:', response);
 						console.error('响应数据结构不符合预期:', response);