123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <div class="hotList">
- <div class="title">
- 今日热点
- <em></em>
- </div>
- <div class="hotList_photo_text">
- <NuxtLink :to="`/newsDetail/${1}`" target="_blank">
- <img src="../../public/index/01.png" alt="">
- <span class="jingxuan">精选</span>
- <div class="hotlist_text">安徽黄山:雪景如画</div>
- </NuxtLink>
- </div>
- <ul class="message">
- <li class="messageList" v-for="(item, index) in 5">
- <NuxtLink :to="`/newsDetail/${1}`" target="_blank">
- 最高检:将研究出台低龄未成年人严重暴力犯罪核准追诉意见
- </NuxtLink>
- </li>
- </ul>
- </div>
- </template>
- <script setup>
- //获得axios
- const nuxtApp = useNuxtApp();
- const axios = nuxtApp.$axios;
- import { onMounted } from 'vue'
- const hotNewsList = ref([])
- //获取详情
- const getHotNews = async () => {
- const response = await axios.get(`/web/getWebsiteArticlett?pageSize=${14}&level=${4}`);
- hotNewsList.value = response.data;
- }
- onMounted(() => {
- getHotNews()
- })
- </script>
- <style lang="less" scoped>
- .title {
- width: 100px;
- height: 40px;
- line-height: 40px;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- margin: 10px 0;
- font-size: 20px;
- color: #333333;
- position: relative;
- em {
- display: inline-block;
- width: 8px;
- height: 8px;
- border-radius: 4px;
- background-color: #a01c0e;
- position: absolute;
- top: 6px;
- right: 8px;
- }
- }
- .hotList_photo_text {
- width: 350px;
- height: 280px;
- position: relative;
- img {
- width: 350px;
- height: 230px;
- }
- .jingxuan {
- display: inline-block;
- width: 50px;
- height: 26px;
- background-color: #a01c0e;
- color: #fff;
- text-align: center;
- line-height: 26px;
- position: absolute;
- top: 0px;
- right: 10px;
- }
- .hotlist_text {
- width: 350px;
- height: 40px;
- line-height: 40px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: bold;
- font-size: 18px;
- color: #333333;
- margin-top: 8px;
- }
- }
- .message {
- width: 350px;
- margin-top: 30px;
- .messageList {
- width: 350px;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 隐藏超出部分 */
- text-overflow: ellipsis;
- /* 超出部分显示省略号 */
- font-family: Microsoft YaHei, Microsoft YaHei;
- font-weight: 400;
- font-size: 18px;
- color: #333333;
- margin-bottom: 25px;
- a {
- color: #333333;
- }
- }
- .messageList:first-child {
- font-weight: bold;
- }
- >li:hover>a {
- color: #a01c0e;
- }
- }
- </style>
|