From 0608a926af3e11794f0f86e8fdff5b7a4ffd9254 Mon Sep 17 00:00:00 2001
From: Daniel Andreas Wang <danielaw@tilde.club>
Date: Thu, 12 Mar 2026 19:18:58 +0100
Subject: render home view

---
 src/views/HomeView.vue | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'src/views/HomeView.vue')

diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 5d3102c..a5290ec 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -1,7 +1,22 @@
 <script setup lang="ts">
+import { onMounted } from 'vue'
+import { useNewsStore } from '@/stores/news'
+
+const store = useNewsStore()
+
+onMounted(() => {
+  store.fetchTopHeadlines({ country: 'us' })
+})
 </script>
 
 <template>
   <main>
+    <p v-if="store.loading">Loading...</p>
+    <p v-else-if="store.error">{{ store.error }}</p>
+    <ul v-else>
+      <li v-for="article in store.articles" :key="article.url">
+        <a :href="article.url" target="_blank">{{ article.title }}</a>
+      </li>
+    </ul>
   </main>
 </template>
-- 
cgit 

