1.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle">
  4. <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
  5. <div>{{ titleLink.alias }}</div>
  6. </NuxtLink>
  7. </div>
  8. <!--样式1-->
  9. <div class="listNewsContent" v-if="componentStyle == 1">
  10. <div v-for="(item, index) in component_style1_News1Array_text">
  11. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  12. :target="item.islink == 1 ? '_blank' : '_self'">
  13. <span>{{ index + 1 }}</span>
  14. {{ item.title }}
  15. </NuxtLink>
  16. </div>
  17. </div>
  18. <!--样式2-->
  19. <div class="listNewsContent style2" v-if="componentStyle == 2">
  20. <div v-for="(item, index) in component_style1_News1Array_text">
  21. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  22. :target="item.islink == 1 ? '_blank' : '_self'">
  23. <span>{{ index + 1 }}</span>
  24. {{ item.title }}
  25. </NuxtLink>
  26. </div>
  27. </div>
  28. <!--样式3-->
  29. <div class="listNewsContent style3" v-if="componentStyle == 3">
  30. <div v-for="(item, index) in component_style1_News1Array_text">
  31. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  32. :target="item.islink == 1 ? '_blank' : '_self'">
  33. <span>{{ index + 1 }}</span>
  34. {{ item.title }}
  35. </NuxtLink>
  36. </div>
  37. </div>
  38. <!--样式4-->
  39. <div class="listNewsContent style4" v-if="componentStyle == 4">
  40. <div v-for="(item, index) in component_style1_News1Array_text">
  41. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  42. :target="item.islink == 1 ? '_blank' : '_self'">
  43. <span>{{ index + 1 }}</span>
  44. {{ item.title }}
  45. </NuxtLink>
  46. </div>
  47. </div>
  48. <!--样式5-->
  49. <div class="listNewsContent" v-if="componentStyle == 5">
  50. <div v-for="item in component_style1_News1Array_text">
  51. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  52. :target="item.islink == 1 ? '_blank' : '_self'">
  53. {{ item.title }}
  54. </NuxtLink>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script setup>
  60. //引入vue
  61. import { ref } from 'vue';
  62. //获得新闻数据
  63. const props = defineProps({
  64. titleLink: Object,//板块名称
  65. templateData: Array,//新闻数据
  66. componentStyle: Number,//样式编号
  67. });
  68. const component_style1_News1Array_text = ref([]);
  69. //真实数据
  70. component_style1_News1Array_text.value = props.templateData.textnum.slice(0, 7);
  71. </script>
  72. <style lang="less" scoped>
  73. //基本样式 start ---------------------------------------->
  74. .listNewsBox {
  75. position: relative;
  76. .listNewsTitle {
  77. height: 38px;
  78. line-height: 38px;
  79. margin-bottom: 19px;
  80. div {
  81. height: 35px;
  82. width: 138px;
  83. line-height: 32px;
  84. font-size: 22px;
  85. font-weight: bold;
  86. color: #333333;
  87. cursor: pointer;
  88. overflow: hidden;
  89. text-overflow: ellipsis;
  90. white-space: nowrap;
  91. color: #154079;
  92. padding-bottom: 5px;
  93. background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042138413493.png") bottom left no-repeat;
  94. }
  95. }
  96. .listNewsContent {
  97. div {
  98. width: 380px;
  99. white-space: nowrap;
  100. overflow: hidden;
  101. text-overflow: ellipsis;
  102. color: #333333;
  103. font-size: 18px;
  104. margin-bottom: 16px;
  105. a {
  106. color: #333333;
  107. span {
  108. font-family: DingTalk JinBuTi;
  109. font-size: 20px;
  110. color: #d9d9d9;
  111. padding-right: 15px;
  112. }
  113. }
  114. &:nth-child(1),
  115. &:nth-child(2),
  116. &:nth-child(3) {
  117. span {
  118. color: #154079;
  119. }
  120. }
  121. &:last-child {
  122. margin-bottom: 0;
  123. }
  124. }
  125. }
  126. // 样式2
  127. .style2 {
  128. div {
  129. a {
  130. color: #333333;
  131. span {
  132. color: #154079;
  133. }
  134. }
  135. }
  136. }
  137. // 样式3
  138. .style3 {
  139. div {
  140. a {
  141. color: #333333;
  142. span {
  143. color: #d9d9d9;
  144. }
  145. }
  146. &:nth-child(1),
  147. &:nth-child(2),
  148. &:nth-child(3) {
  149. span {
  150. color: #333333;
  151. }
  152. }
  153. }
  154. }
  155. // 样式4
  156. .style4 {
  157. div {
  158. a {
  159. color: #333333;
  160. span {
  161. color: #333333;
  162. }
  163. }
  164. &:nth-child(1),
  165. &:nth-child(2),
  166. &:nth-child(3) {
  167. span {
  168. color: #333333;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. //基本样式 end ----------------------------------------></style>