2.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div class="hotNewsBox">
  3. <div class="listNewsTitle" v-if="skinId==1">
  4. <b>最新资讯</b>
  5. </div>
  6. <div class="listNewsTitle_skin2" v-if="skinId==2">
  7. <span><b>最新资讯</b></span>
  8. </div>
  9. <div class="hotNewsContent" v-if="skinId==1">
  10. <div v-for="(item,index) in component_style1_News1Array">
  11. <NuxtLink
  12. :href="getLinkPathDetail(item)"
  13. :title="item.title"
  14. :target="item.islink == 1 ? '_blank' : '_self'"
  15. >
  16. <span>{{ index+1 }}</span>
  17. {{ item.title }}
  18. </NuxtLink>
  19. </div>
  20. </div>
  21. <div class="hotNewsContent_skin2" v-if="skinId==2">
  22. <div v-for="(item,index) in component_style1_News1Array">
  23. <NuxtLink
  24. :href="getLinkPathDetail(item)"
  25. :title="item.title"
  26. :target="item.islink == 1 ? '_blank' : '_self'"
  27. >
  28. <span>{{ index+1 }}</span>
  29. {{ item.title }}
  30. </NuxtLink>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script setup>
  36. //引入vue
  37. import {ref} from 'vue';
  38. //获得新闻数据
  39. const props = defineProps({
  40. templateData:Array,//新闻数据
  41. skinId:String,//皮肤id
  42. });
  43. const component_style1_News1Array = ref([]);
  44. component_style1_News1Array.value = props.templateData.text.slice(0,8);
  45. </script>
  46. <style lang="less" scoped>
  47. .hotNewsBox {
  48. .listNewsTitle {
  49. font-size:22px;
  50. font-weight:bold;
  51. height: 40px;
  52. line-height: 40px;
  53. border-bottom: 2px solid #004564;
  54. color:#004564;
  55. margin-bottom: 20px;
  56. box-sizing: border-box;
  57. b {
  58. color:#004564;
  59. display: block;
  60. height: 25px;
  61. line-height: 25px;
  62. }
  63. }
  64. .listNewsTitle_skin2 {
  65. font-size:22px;
  66. font-weight:bold;
  67. height: 40px;
  68. line-height: 40px;
  69. border-bottom: 2px solid #A91B33;
  70. color:#A91B33;
  71. margin-bottom: 20px;
  72. box-sizing: border-box;
  73. b {
  74. color:#A91B33;
  75. display: block;
  76. height: 25px;
  77. line-height: 25px;
  78. }
  79. span {
  80. color:#A91B33;
  81. height: 25px;
  82. line-height: 25px;
  83. border-left: 3px solid #A91B33;
  84. padding-left: 12px;
  85. display: block;
  86. }
  87. }
  88. .hotNewsContent {
  89. font-size:18px;
  90. color:#333333;
  91. div {
  92. a {
  93. display: block;
  94. color:#333333;
  95. overflow: hidden;
  96. white-space: nowrap;
  97. text-overflow: ellipsis;
  98. }
  99. padding-bottom:20px;
  100. border-bottom:1px solid #E4E4E4;
  101. margin-bottom: 22px;
  102. span {
  103. margin-right: 15px;
  104. font-size:20px;
  105. font-weight:bold;
  106. font-style: italic;
  107. color: #004564;
  108. }
  109. }
  110. }
  111. .hotNewsContent_skin2 {
  112. font-size:18px;
  113. color:#333333;
  114. div {
  115. padding-bottom:20px;
  116. border-bottom:1px solid #E4E4E4;
  117. margin-bottom: 22px;
  118. a {
  119. display: block;
  120. color:#333333;
  121. overflow: hidden;
  122. white-space: nowrap;
  123. text-overflow: ellipsis;
  124. }
  125. span {
  126. margin-right: 15px;
  127. font-size:20px;
  128. font-weight:bold;
  129. font-style: italic;
  130. color: #A91B33;
  131. }
  132. }
  133. }
  134. }
  135. </style>