| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <template>
- <!--皮肤1和皮肤2的 第二个样式是一样的-->
- <div class="BannerListBox BannerListBoxStyle1" v-if="componentStyle==1">
- <div v-for="item in component_News" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <!--皮肤1和皮肤2的 第二个样式是一样的-->
- <div class="BannerListBox BannerListBoxStyle2" v-if="componentStyle==2">
- <div v-for="item in component_News" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <!-- 样式3 -->
- <div class="BannerListBox BannerListBoxStyle3" v-if="componentStyle == 3">
- <div v-for="item in component_News" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <!-- 样式4 -->
- <div class="BannerListBox BannerListBoxStyle4" v-if="componentStyle == 4">
- <div v-for="item in component_News" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <!-- 样式5 -->
- <div class="BannerListBox BannerListBoxStyle5" v-if="componentStyle == 5">
- <div v-for="item in component_News" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- <!-- 样式6 -->
- <div class="BannerListBox BannerListBoxStyle6" v-if="componentStyle == 6">
- <div class="listNewsTitle">
- <span>头条新闻</span>
- </div>
- <div v-for="item in component_News_1" :key="item.id">
- <NuxtLink
- :href="getLinkPathDetail(item)"
- :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'"
- >
- {{ item.title }}
- </NuxtLink>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import {ref} from 'vue';
- //获得新闻数据
- const props = defineProps({
- componentStyle:Number,//样式编号
- templateData:Array,//新闻数据
- });
- //获取新闻数据
- const component_News = ref(props.templateData);
- const component_News_1 = component_News.value.slice(0,9);
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .BannerListBox {
- div {
- cursor: pointer;
- font-size:18px;
- color: #333;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- height:26px;
- line-height: 26px;
- margin-bottom: 16px;
- a {
- font-size:18px;
- color: #333;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- //基本样式 end ---------------------------------------->
- //样式1 start ---------------------------------------->
- .BannerListBoxStyle1 {
- div {
- cursor: pointer;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- height:26px;
- line-height: 26px;
- margin-bottom: 16px;
- a {
- font-size:18px;
- color: #333;
- }
- &:nth-child(1),&:nth-child(6){
- a {
- color: #A91B33;
- font-weight: bold;
- }
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- //样式1 end ---------------------------------------->
- //样式2 start ---------------------------------------->
- .BannerListBoxStyle2 {
- div {
- a {
- color: #333;
- }
- &:nth-child(1),&:nth-child(6){
- a {
- color: #333333;
- font-weight: bold;
- }
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- //样式2 end ---------------------------------------->
- //样式3
- .BannerListBoxStyle3 {
- div {
- a {
- color: #333;
- }
- &:nth-child(1){
- a {
- color: #A91B33;
- font-weight: bold;
- }
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- //样式4
- .BannerListBoxStyle4 {
- div {
- a {
- color: #333;
- }
- &:nth-child(1){
- a {
- color: #333333;
- font-weight: bold;
- }
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- //样式5
- .BannerListBoxStyle5 {
- div{
- a {
- color: #333;
- }
- }
- }
- //样式6
- .BannerListBoxStyle6 {
- div{
- margin-bottom: 14px;
- }
- .listNewsTitle {
- font-size: 22px;
- font-weight: bold;
- height: 40px;
- line-height: 40px;
- border-bottom: 1px solid #e4e4e4;
- color: #A91B33;
- margin-bottom: 20px;
- box-sizing: border-box;
- padding-bottom: 45px;
- span {
- color: #A91B33;
- height: 30px;
- line-height: 30px;
- border-left: 3px solid #A91B33;
- padding-left: 12px;
- font-weight: bold;
- }
- }
- }
- </style>
|