2.vue 1.7 KB

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