news-analyze/components/app/hot/index.vue
吳元皓 930713042e refactor: remove GitHub authentication API endpoints and add new components
- Deleted GitHub callback and authentication handler files.
- Added new component for displaying headlines.
- Implemented hot news feed component with external API fetching.
- Created dynamic news provider page with routing.
- Developed news organization about page with animations and data fetching.
- Introduced a code of conduct document.
2025-05-11 14:37:46 +08:00

64 lines
1.8 KiB
Vue

<script lang="ts" setup>
const ffeed = ref();
const ass = ["健康2.0", "中天", "TVBS", "香港01", "ETtoday"];
import Button from "~/components/ui/button/Button.vue";
try {
const { data } = await useFetch("/api/rss/google");
ffeed.value = data.value;
} catch (error) {
console.error("Error:", error);
}
</script>
<template>
<div
v-for="item in ffeed"
class="justify-center align-center text-center p-4 border border-white rounded-lg m-4"
>
<span class="text-xl text-bold text-gray-100"
>{{ item.title }}
<span
v-if="ass.some((app) => item.title.includes(app))"
class="text-red-500 text-sm"
>
&nbsp;- 疑似來自有中資背景公司
</span>
</span>
<h4 class="text-gray-500 text-sm">
{{ new Date(item.date).toLocaleString() }}
</h4>
<div class="flex justify-center gap-2 mt-1">
<NuxtLink :to="item.link">
<Button>文章</Button>
</NuxtLink>
<NuxtLink>
<Button>關於媒體</Button>
</NuxtLink>
</div>
<br />
類似新聞:
<div v-for="itit in item.content">
<ul v-for="ititit in itit">
<li v-if="ititit.content?.[0].content[0] !== item.title">
&nbsp; -
<a :href="ititit.content?.[0].attributes?.href">{{
ititit.content?.[0].content[0]
}}</a>
-
<a :href="'/find/newsOrg?name=' + ititit.content?.[2].content[0]">{{
ititit.content?.[2].content[0]
}}</a>
<span
v-if="
ass.some((app) => ititit.content?.[2].content[0].includes(app))
"
class="text-red-500 text-sm"
>
&nbsp;- 疑似來自有中資背景公司
</span>
</li>
</ul>
</div>
</div>
</template>