richText.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 :content="description" ref="article" :tag-style="tagStyle"></jyf-parser>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import parser from "@/components/mp-html/mp-html";
  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%;'
  29. },
  30. bgColor:this.dataConfig.bgColor.color[0].item,
  31. lrConfig:this.dataConfig.lrConfig.val,
  32. description:this.dataConfig.richText.val,
  33. udConfig:this.dataConfig.udConfig.val
  34. };
  35. },
  36. created() {},
  37. methods: {
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .richText{
  43. padding: 20rpx;
  44. background-color: #fff;
  45. margin: 0 20rpx;
  46. border-radius: 24rpx;
  47. }
  48. /deep/uni-video{
  49. width: 100%!important;
  50. }
  51. /deep/video{
  52. width: 100%!important;
  53. }
  54. </style>