6.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="listNewsBox" v-if="componentStyle == 1">
  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="component_style1_News1Array.length > 0">
  10. <div v-for="item in component_style1_News1Array">
  11. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
  12. :target="item.islink == 1 ? '_blank' : '_self'">
  13. <img :src="item.imgurl" alt="">
  14. <span>{{ item.title }}</span>
  15. </NuxtLink>
  16. </div>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup>
  21. //引入vue
  22. import { ref } from 'vue';
  23. //获得新闻数据
  24. const props = defineProps({
  25. titleLink: Object,//板块名称
  26. templateData: Array,//新闻数据
  27. componentStyle: Number,//样式编号
  28. });
  29. //当前选中的tab
  30. const activeTab = ref(0);
  31. const component_style1_News1Array = ref([]);
  32. //真实数据
  33. component_style1_News1Array.value = props.templateData;
  34. </script>
  35. <style lang="less" scoped>
  36. //基本样式 start ---------------------------------------->
  37. .listNewsBox {
  38. position: relative;
  39. .listNewsTitle {
  40. height: 38px;
  41. line-height: 38px;
  42. margin-bottom: 19px;
  43. div {
  44. height: 35px;
  45. width: 138px;
  46. line-height: 32px;
  47. font-size: 22px;
  48. font-weight: bold;
  49. color: #333333;
  50. cursor: pointer;
  51. overflow: hidden;
  52. text-overflow: ellipsis;
  53. white-space: nowrap;
  54. color: #154079;
  55. padding-bottom: 5px;
  56. background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042138413493.png") bottom left no-repeat;
  57. }
  58. }
  59. .listNewsContent {
  60. position: relative;
  61. div {
  62. a {
  63. img {
  64. width: 374px;
  65. height: 264px;
  66. }
  67. span {
  68. display: inline-block;
  69. width: 374px;
  70. height: 50px;
  71. line-height: 50px;
  72. font-size: 16px;
  73. font-weight: bold;
  74. color: #fff;
  75. position: absolute;
  76. bottom: 0;
  77. left: 0;
  78. padding-left: 15px;
  79. background-color: rgba(0, 0, 0, 0.2);
  80. }
  81. }
  82. }
  83. }
  84. }
  85. //基本样式 end ----------------------------------------></style>