NewsInfo.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div
  3. class="news-info"
  4. >
  5. <div class="icon">
  6. <!-- <div class="dot" v-if="dot">{{ dot }}</div> -->
  7. <image style="width: 50px;height: 50px;border-radius: 50%;" src="https://bpic.588ku.com/illus_water_img/21/07/05/ecab6de5a7b2972500459ba95cf97deb.jpg" mode=""></image>
  8. </div>
  9. <div class="content">
  10. <div class="text1">
  11. 333
  12. </div>
  13. <span class="time">1111</span>
  14. <div class="text2">222</div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. // import { mapState } from 'vuex';
  20. // import dayjs from 'dayjs';
  21. // import * as relativeTime from 'dayjs/plugin/relativeTime';
  22. // import 'dayjs/locale/zh-cn';
  23. // dayjs.locale('zh-cn');
  24. // dayjs.extend(relativeTime);
  25. export default {
  26. name: 'NewsInfo',
  27. props: {
  28. info: {
  29. type: Object,
  30. default: () => {
  31. return {};
  32. }
  33. },
  34. dot: {
  35. type: Number,
  36. default: 0
  37. }
  38. },
  39. };
  40. </script>
  41. <style lang="scss" scoped>
  42. .news-info {
  43. // .flex();
  44. display: flex;
  45. align-items: center;
  46. padding: 20px 0;
  47. overflow: hidden;
  48. border-bottom: 1px solid #F5F7FA;
  49. .icon {
  50. flex-shrink: 0;
  51. margin-right: 8px;
  52. position: relative;
  53. .dot {
  54. min-width: 6px;
  55. height: 18px;
  56. font-size: 13px;
  57. color: #ffffff;
  58. line-height: 18px;
  59. padding: 0 6px;
  60. text-align: center;
  61. position: absolute;
  62. left: 36px;
  63. top: -6px;
  64. // background: @prim;
  65. border-radius: 9px;
  66. }
  67. }
  68. .content {
  69. flex-grow: 1;
  70. overflow: hidden;
  71. position: relative;
  72. .text1 {
  73. font-size: 16px;
  74. font-weight: bold;
  75. color: #000000;
  76. line-height: 26px;
  77. }
  78. .text2 {
  79. font-size: 14px;
  80. color: #c8c9cc;
  81. line-height: 24px;
  82. // .ellipsis();
  83. }
  84. .time {
  85. font-size: 13px;
  86. color: #c8c9cc;
  87. line-height: 24px;
  88. position: absolute;
  89. right: 0px;
  90. top: 0;
  91. }
  92. }
  93. &:active {
  94. background-color: rgba(0, 0, 0, 0.1);
  95. }
  96. }
  97. </style>