richText.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class='richText' :style="'background-color:'+bgColor+';margin:'+ udConfig +'rpx '+ lrConfig +'rpx;'" v-if="description">
  3. <!-- <view>大法官好地方规划的法规</view> -->
  4. <!-- #ifndef APP-PLUS -->
  5. <jyf-parser :domain='domain' :html="description.replace(/<br\/>/ig, '')" ref="article" :tag-style="tagStyle"></jyf-parser>
  6. <!-- #endif -->
  7. <!-- #ifdef APP-PLUS -->
  8. <view class="description" v-html="description"></view>
  9. <!-- #endif -->
  10. </view>
  11. </template>
  12. <script>
  13. // +----------------------------------------------------------------------
  14. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  15. // +----------------------------------------------------------------------
  16. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  17. // +----------------------------------------------------------------------
  18. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  19. // +----------------------------------------------------------------------
  20. // | Author: CRMEB Team <admin@crmeb.com>
  21. // +----------------------------------------------------------------------
  22. import parser from "@/components/jyf-parser/jyf-parser";
  23. import { HTTP_REQUEST_URL } from '@/config/app';
  24. export default {
  25. name: 'richText',
  26. props: {
  27. dataConfig: {
  28. type: Object,
  29. default: () => {}
  30. }
  31. },
  32. components: {
  33. "jyf-parser": parser
  34. },
  35. data() {
  36. return {
  37. tagStyle: {
  38. img: 'width:100%;'
  39. },
  40. bgColor:this.dataConfig.bgColor.color[0].item,
  41. lrConfig:this.dataConfig.lrConfig.val * 2,
  42. description:this.dataConfig.richText.val,
  43. udConfig:this.dataConfig.udConfig.val * 2,
  44. domain: HTTP_REQUEST_URL,
  45. };
  46. },
  47. created() {},
  48. methods: {}
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .richText{
  53. padding: 20rpx;
  54. background-color: #fff;
  55. margin: 0 20rpx;
  56. }
  57. </style>