| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <template>
- <div>
- <div v-if="componentStyle == 1">
- <div class="list_left_li_1" v-for="item in listData.slice(0, 10)">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <div class="list_left_li_head">
- <div class="list_left_li_time"> {{ item.updated_at }}</div>
- <h4 class="list_left_li_h4">{{ item.title }}</h4>
- </div>
- <div class="list_left_li_dot3"> {{ item.introduce }}</div>
- </NuxtLink>
- </div>
- </div>
- <div v-if="componentStyle == 2">
- <div class="list_left_li_2" v-for="item in listData.slice(0, 10)">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <div class="list_left_li_head">
- <div class="list_left_li_time"> {{ item.updated_at }}</div>
- <h4 class="list_left_li_h4">{{ item.title }}</h4>
- </div>
- <div class="list_left_li_dot3"> {{ item.introduce }}</div>
- </NuxtLink>
- </div>
- </div>
- <div v-if="componentStyle == 3">
- <div class="list_left_li_3" v-for="item in listData.slice(0, 10)">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <div class="list_left_li_head">
- <div class="list_left_li_time"> {{ item.updated_at }}</div>
- <h4 class="list_left_li_h4">{{ item.title }}</h4>
- </div>
- <div class="list_left_li_dot3"> {{ item.introduce }}</div>
- </NuxtLink>
- </div>
- </div>
- <div v-if="componentStyle == 4">
- <div class="list_left_li_4" v-for="item in listData.slice(0, 10)">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <div class="list_left_li_head">
- <div class="list_left_li_time"> {{ item.updated_at }}</div>
- <h4 class="list_left_li_h4">{{ item.title }}</h4>
- </div>
- <div class="list_left_li_dot3"> {{ item.introduce }}</div>
- </NuxtLink>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import { ref } from 'vue';
- //获得新闻数据
- const props = defineProps({
- listData: Array,//新闻数据
- componentStyle: Number//组件样式
- });
- </script>
- <style lang="less" scoped>
- .list_left_li_1 {
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- height: 140px;
- border: solid 1px rgba(0, 0, 0, 0);
- border-bottom: dashed 1px #999;
- .list_left_li_a {
- display: block;
- width: 100%;
- height: 100%;
- }
- .list_left_li_head {
- height: 24px;
- margin-top: 20px;
- }
- .list_left_li_time {
- float: right;
- height: 24px;
- line-height: 24px;
- color: #999;
- font-size: 18px;
- margin-left: 20px;
- }
- .list_left_li_h4 {
- height: 24px;
- display: block;
- line-height: 24px;
- color: #333;
- font-size: 18px;
- position: relative;
- font-weight: bold;
- text-indent: 16px;
- margin: 0;
- display: block;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .list_left_li_h4::after {
- content: "";
- position: absolute;
- top: 10px;
- left: 0px;
- width: 6px;
- height: 6px;
- background: #F2F2F2;
- }
- .list_left_li_dot3 {
- height: 63px;
- line-height: 21px;
- color: #999;
- font-size: 16px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 16px;
- margin-top: 15px;
- overflow: hidden;
- display: -webkit-box !important;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- }
- &:nth-child(1) {
- height: 120px;
- }
- &:nth-child(1) .list_left_li_head {
- margin-top: 0px;
- }
- }
- .list_left_li_2 {
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- height: 140px;
- border: solid 1px rgba(0, 0, 0, 0);
- border-bottom: solid 1px #999;
- .list_left_li_a {
- display: block;
- width: 100%;
- height: 100%;
- }
- .list_left_li_head {
- height: 24px;
- margin-top: 20px;
- }
- .list_left_li_time {
- float: right;
- height: 24px;
- line-height: 24px;
- color: #999;
- font-size: 18px;
- margin-left: 20px;
- }
- .list_left_li_h4 {
- height: 24px;
- display: block;
- line-height: 24px;
- color: #333;
- font-size: 18px;
- position: relative;
- font-weight: bold;
- text-indent: 16px;
- margin: 0;
- display: block;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .list_left_li_h4::after {
- content: "";
- position: absolute;
- top: 10px;
- left: 0px;
- width: 6px;
- height: 6px;
- background: #F2F2F2;
- }
- .list_left_li_dot3 {
- height: 63px;
- line-height: 21px;
- color: #999;
- font-size: 16px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 16px;
- margin-top: 15px;
- overflow: hidden;
- display: -webkit-box !important;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- }
- &:nth-child(1) {
- height: 120px;
- }
- &:nth-child(1) .list_left_li_head {
- margin-top: 0px;
- }
- }
- .list_left_li_3 {
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- height: 140px;
- border: solid 1px rgba(0, 0, 0, 0);
- border-bottom: dashed 1px #999;
- .list_left_li_a {
- display: block;
- width: 100%;
- height: 100%;
- }
- .list_left_li_head {
- height: 24px;
- margin-top: 20px;
- }
- .list_left_li_time {
- float: right;
- height: 24px;
- line-height: 24px;
- color: #999;
- font-size: 18px;
- margin-left: 20px;
- }
- .list_left_li_h4 {
- height: 24px;
- display: block;
- line-height: 24px;
- color: #333;
- font-size: 18px;
- position: relative;
- font-weight: normal;
- text-indent: 16px;
- margin: 0;
- display: block;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .list_left_li_h4::after {
- content: "";
- position: absolute;
- top: 10px;
- left: 0px;
- width: 6px;
- height: 6px;
- background: #F2F2F2;
- }
- .list_left_li_dot3 {
- height: 63px;
- line-height: 21px;
- color: #999;
- font-size: 16px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 16px;
- margin-top: 15px;
- overflow: hidden;
- display: -webkit-box !important;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- }
- &:nth-child(1) {
- height: 120px;
- }
- &:nth-child(1) .list_left_li_head {
- margin-top: 0px;
- }
- }
- .list_left_li_4 {
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- height: 140px;
- border: solid 1px rgba(0, 0, 0, 0);
- border-bottom: solid 1px #999;
- .list_left_li_a {
- display: block;
- width: 100%;
- height: 100%;
- }
- .list_left_li_head {
- height: 24px;
- margin-top: 20px;
- }
- .list_left_li_time {
- float: right;
- height: 24px;
- line-height: 24px;
- color: #999;
- font-size: 18px;
- margin-left: 20px;
- }
- .list_left_li_h4 {
- height: 24px;
- display: block;
- line-height: 24px;
- color: #333;
- font-size: 18px;
- position: relative;
- font-weight: normal;
- text-indent: 16px;
- margin: 0;
- display: block;
- word-break: keep-all;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .list_left_li_h4::after {
- content: "";
- position: absolute;
- top: 10px;
- left: 0px;
- width: 6px;
- height: 6px;
- background: #F2F2F2;
- }
- .list_left_li_dot3 {
- height: 63px;
- line-height: 21px;
- color: #999;
- font-size: 16px;
- width: 100%;
- box-sizing: border-box;
- padding-left: 16px;
- margin-top: 15px;
- overflow: hidden;
- display: -webkit-box !important;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3;
- }
- &:nth-child(1) {
- height: 120px;
- }
- &:nth-child(1) .list_left_li_head {
- margin-top: 0px;
- }
- }
- </style>
|