contentText.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="detail-desc">
  3. <view class="d-header"><text>图文详情</text></view>
  4. <rich-text class="detail-centent" :nodes="description"></rich-text>
  5. <!-- 底部高度撑开 -->
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. props: {
  11. description: {
  12. default: ''
  13. },
  14. },
  15. data() {
  16. return {
  17. };
  18. },
  19. };
  20. </script>
  21. <style lang="scss">
  22. p {
  23. display: block;
  24. margin-block-start: 0px;
  25. margin-block-end: 0px;
  26. margin-inline-start: 0px;
  27. margin-inline-end: 0px;
  28. }
  29. /* 详情 */
  30. .detail-desc {
  31. margin-top: 14rpx;
  32. background: #fff;
  33. /deep/ img {
  34. max-width: 100% !important;
  35. display: inline !important;
  36. }
  37. /deep/ div {
  38. max-width: 100% !important;
  39. }
  40. .d-header {
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. height: 80rpx;
  45. font-size: $font-base + 2rpx;
  46. color: $font-color-dark;
  47. position: relative;
  48. text {
  49. padding: 0 20rpx;
  50. background: #fff;
  51. position: relative;
  52. z-index: 1;
  53. }
  54. &:after {
  55. position: absolute;
  56. left: 50%;
  57. top: 50%;
  58. transform: translateX(-50%);
  59. width: 300rpx;
  60. height: 0;
  61. content: '';
  62. border-bottom: 1px solid #ccc;
  63. }
  64. }
  65. }
  66. /* 商品详情中限制图片大小 */
  67. /deep/ .rich-img {
  68. width: 100% !important;
  69. height: auto;
  70. vertical-align: top;
  71. }
  72. .detail-centent {
  73. img {
  74. vertical-align: top;
  75. }
  76. }
  77. </style>