richText.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view v-show="!isSortType">
  3. <view class='richText' :style="'background-color:'+bgColor+';margin:'+ udConfig +'rpx '+ lrConfig +'rpx;'" v-if="description">
  4. <jyf-parser :html="description" ref="article" :tag-style="tagStyle"></jyf-parser>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import parser from "@/components/jyf-parser/jyf-parser";
  10. export default {
  11. name: 'richText',
  12. props: {
  13. dataConfig: {
  14. type: Object,
  15. default: () => {}
  16. },
  17. isSortType:{
  18. type: String | Number,
  19. default:0
  20. }
  21. },
  22. components: {
  23. "jyf-parser": parser
  24. },
  25. data() {
  26. return {
  27. tagStyle: {
  28. img: 'width:100%;display:block;',
  29. table: 'width:100%',
  30. video: 'width:100%'
  31. },
  32. bgColor:this.dataConfig.bgColor.color[0].item,
  33. lrConfig:this.dataConfig.lrConfig.val,
  34. description:this.dataConfig.richText.val,
  35. udConfig:this.dataConfig.udConfig.val
  36. };
  37. },
  38. created() {},
  39. methods: {
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. .richText{
  45. padding: 20rpx;
  46. background-color: #fff;
  47. margin: 0 20rpx;
  48. border-radius: 24rpx;
  49. }
  50. /deep/uni-video{
  51. width: 100%!important;
  52. }
  53. /deep/video{
  54. width: 100%!important;
  55. }
  56. </style>