抗战 书房

main
lion 2 months ago
parent 5d496acf90
commit 747e70dd6e

@ -20,7 +20,8 @@
<image :src="info.image.url" mode="widthFix"></image>
</view>
<view class="detail-content-content">
<rich-text v-if='showContent' :nodes="info.content?info.content:' '"></rich-text>
<u-parse v-if='showContent' :html="info.content?info.content:' '"></u-parse>
<!-- <rich-text v-if='showContent' :nodes="info.content?info.content:' '"></rich-text> -->
</view>
</view>
</view>
@ -71,8 +72,16 @@
'with_relations[0]': 'image'
})
this.info = res
this.info.content = this.replaceStoragePath(res.content)
console.log(this.info.content)
this.showContent = true
},
replaceStoragePath(htmlStr) {
// src ../storage
const regex = /src=["']\..\/storage/g;
//
return htmlStr.replace(regex, 'src="https://h5.jscnsaas.cn/storage');
}
}
}
</script>

Loading…
Cancel
Save