contentText.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /* 详情 */
  23. .detail-desc {
  24. margin-top: 14rpx;
  25. // background: #fff;
  26. /deep/ img {
  27. max-width: 100% !important;
  28. display: inline !important;
  29. }
  30. /deep/ div {
  31. max-width: 100% !important;
  32. }
  33. .d-header {
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. height: 80rpx;
  38. font-size: $font-base + 2rpx;
  39. color: $font-color-dark;
  40. position: relative;
  41. text {
  42. padding: 0 20rpx;
  43. background: #f0f0f0;
  44. position: relative;
  45. z-index: 1;
  46. overflow: hidden;
  47. }
  48. &:after {
  49. position: absolute;
  50. left: 50%;
  51. top: 50%;
  52. transform: translateX(-50%);
  53. width: 250rpx;
  54. height: 0;
  55. content: '';
  56. border-bottom: 1px solid #ccc;
  57. }
  58. }
  59. }
  60. /* 商品详情中限制图片大小 */
  61. /deep/ .rich-img {
  62. width: 100% !important;
  63. height: auto;
  64. }
  65. </style>