1.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="BannerListBoxStyle1" v-if="skinId=='1'">
  3. <div v-for="item in component_News" :key="item.id">
  4. <NuxtLink
  5. :href="getLinkPathDetail(item)"
  6. :title="item.title"
  7. :target="item.islink == 1 ? '_blank' : '_self'"
  8. >
  9. {{ item.title }}
  10. </NuxtLink>
  11. </div>
  12. </div>
  13. <div class="BannerListBoxStyle1_skin2" v-if="skinId=='2'">
  14. <div v-for="item in component_News" :key="item.id">
  15. <NuxtLink
  16. :href="getLinkPathDetail(item)"
  17. :title="item.title"
  18. :target="item.islink == 1 ? '_blank' : '_self'"
  19. >
  20. {{ item.title }}
  21. </NuxtLink>
  22. </div>
  23. </div>
  24. </template>
  25. <script setup>
  26. //引入vue
  27. import {ref} from 'vue';
  28. //获得新闻数据
  29. const props = defineProps({
  30. skinId:String,//皮肤编号
  31. templateData:Array,//新闻数据
  32. });
  33. //获取新闻数据
  34. const component_News = ref(props.templateData);
  35. </script>
  36. <style lang="less" scoped>
  37. .BannerListBoxStyle1 {
  38. div {
  39. cursor: pointer;
  40. overflow: hidden;
  41. text-overflow: ellipsis;
  42. white-space: nowrap;
  43. height:26px;
  44. line-height: 26px;
  45. margin-bottom: 16px;
  46. a {
  47. font-size:18px;
  48. color: #333;
  49. }
  50. &:nth-child(1),&:nth-child(6){
  51. a {
  52. color: #004564;
  53. font-weight: bold;
  54. }
  55. }
  56. &:last-child {
  57. margin-bottom: 0;
  58. }
  59. }
  60. }
  61. .BannerListBoxStyle1_skin2 {
  62. div {
  63. cursor: pointer;
  64. font-size:18px;
  65. color: #333;
  66. overflow: hidden;
  67. text-overflow: ellipsis;
  68. white-space: nowrap;
  69. height:26px;
  70. line-height: 26px;
  71. margin-bottom: 16px;
  72. a {
  73. font-size:18px;
  74. color: #333;
  75. }
  76. &:nth-child(1),&:nth-child(6){
  77. a {
  78. color: #A91B33;
  79. font-weight: bold;
  80. }
  81. }
  82. &:last-child {
  83. margin-bottom: 0;
  84. }
  85. }
  86. }
  87. </style>