通过 CSS 设置样式行不通,只能修改返回的数据了
<view v-html="introducehtml" v-if="introducehtml != ''"></view>
js
getGoodsDetail(id) {ceshiApi['GoodsDetail']({id: id }).then((res) => {if (res.data.flag === '200') {let obj = res.data.response// CSS 设置样式行不通,只能修改返回的数据了;这一步是最重要的!this.introducehtml = obj.description.replace(/<img/g,"<img style='max-width:100%';height:auto;")}).catch((error) => {console.log(error)})},