Huanyuyuehui/pages/index/component/richText.vue

53 lines
1.2 KiB
Vue
Raw Normal View History

2024-03-21 17:52:58 +08:00
<template>
<view class='richText' :style="'background-color:'+bgColor+';margin:'+ udConfig +'rpx '+ lrConfig +'rpx;'" v-if="description">
<!-- <view>大法官好地方规划的法规</view> -->
<!-- #ifndef APP-PLUS -->
<jyf-parser :domain='domain' :html="description.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="description" v-html="description"></view>
<!-- #endif -->
</view>
</template>
<script>
2024-03-21 18:05:36 +08:00
2024-03-21 17:52:58 +08:00
import parser from "@/components/jyf-parser/jyf-parser";
import { HTTP_REQUEST_URL } from '@/config/app';
export default {
name: 'richText',
props: {
dataConfig: {
type: Object,
default: () => {}
}
},
components: {
"jyf-parser": parser
},
data() {
return {
tagStyle: {
img: 'width:100%;'
},
bgColor:this.dataConfig.bgColor.color[0].item,
lrConfig:this.dataConfig.lrConfig.val * 2,
description:this.dataConfig.richText.val,
udConfig:this.dataConfig.udConfig.val * 2,
domain: HTTP_REQUEST_URL,
};
},
created() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.richText{
padding: 20rpx;
background-color: #fff;
margin: 0 20rpx;
}
</style>