Przeglądaj źródła

处理富文本图片样式

sakura 1 rok temu
rodzic
commit
f128c8172d
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      pages/home/detail/detail.vue

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

@@ -356,6 +356,7 @@
 					if (response && response.data) {
 						_this.eventsInfo = response.data; // 确保 response.data 存在
 						_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 确认数据
 					} else {
 						console.error('响应数据结构不符合预期:', response);