1. 通过 >>> 穿透修改
<style scoped>
	.pro{
		margin: 0 24upx;
		font-size: 14px;
		font-family:PingFang-SC-Medium,PingFang-SC;
	}
	.pro >>> p{
		margin-top:16px;
		font-size: 14px;
	}
</style>
  1. 如果lang设置为scss时,则通过 /deep/ 修改
<style lang="scss" scoped>
	.pro{
		margin: 0 24upx;
		font-size: 14px;
		font-family:PingFang-SC-Medium,PingFang-SC;
	}
	.pro /deep/ p:nth-child(2){
		text-indent: 2em;
	}
</style>

3.通过正则来修改

this.detail = data.detail.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');;

将获取到的富文本内容进行过滤

Logo

前往低代码交流专区

更多推荐