contentText.vue 1.3 KB

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