hookehuyr

fix 详情页富文本显示,给所有 img 标签添加 mode 缩放模式

1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-28 11:28:30 4 + * @LastEditTime: 2024-03-28 13:00:53
5 * @FilePath: /meihuaApp/src/pages/detail/index.vue 5 * @FilePath: /meihuaApp/src/pages/detail/index.vue
6 * @Description: 房间详情页面 6 * @Description: 房间详情页面
7 --> 7 -->
...@@ -184,6 +184,13 @@ onMounted(async () => { ...@@ -184,6 +184,13 @@ onMounted(async () => {
184 }) 184 })
185 }); 185 });
186 } 186 }
187 + // 给所有 img 标签添加 mode 缩放模式
188 + Taro.options.html.transformElement = (el) => {
189 + if (el.nodeName === 'image') {
190 + el.setAttribute('mode', 'widthFix')
191 + }
192 + return el
193 + }
187 } 194 }
188 }); 195 });
189 196
......