richText.vue 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class='richText' :style="'background-color:'+bgColor+';margin:'+ udConfig +'rpx '+ lrConfig +'rpx;'" v-if="description">
  3. <!-- <view>大法官好地方规划的法规</view> -->
  4. <jyf-parser :html="description" ref="article" :tag-style="tagStyle"></jyf-parser>
  5. </view>
  6. </template>
  7. <script>
  8. import parser from "@/components/jyf-parser/jyf-parser";
  9. export default {
  10. name: 'richText',
  11. props: {
  12. dataConfig: {
  13. type: Object,
  14. default: () => {}
  15. }
  16. },
  17. components: {
  18. "jyf-parser": parser
  19. },
  20. data() {
  21. return {
  22. tagStyle: {
  23. img: 'width:100%;'
  24. },
  25. bgColor:this.dataConfig.bgColor.color[0].item,
  26. lrConfig:this.dataConfig.lrConfig.val,
  27. description:this.dataConfig.richText.val,
  28. udConfig:this.dataConfig.udConfig.val * 2
  29. };
  30. },
  31. created() {},
  32. methods: {
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. .richText{
  38. padding: 20rpx;
  39. background-color: #fff;
  40. margin: 0 20rpx;
  41. border-radius: 24rpx;
  42. }
  43. </style>