mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
TEMP Article page implementation
This commit is contained in:
@@ -1,10 +1,38 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { getArticles, type Article } from '@/utils/database';
|
||||||
|
import { onMounted, ref, type Ref } from 'vue';
|
||||||
import { RouterLink } from 'vue-router'
|
import { RouterLink } from 'vue-router'
|
||||||
|
|
||||||
|
const articles: Ref<Array<Article>> = ref([])
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
articles.value = await getArticles('')
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main>
|
<main>
|
||||||
<RouterLink class="button-primary" to="/articles/new">Créer un article</RouterLink>
|
<RouterLink class="button-primary" to="/articles/new">Créer un article</RouterLink>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<th>Titre</th>
|
||||||
|
<th>Date création</th>
|
||||||
|
<th>Tags</th>
|
||||||
|
<th>Statut</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="article in articles">
|
||||||
|
<td>{{ article.title }}</td>
|
||||||
|
<td>{{ new Date(article.date).toLocaleDateString('fr-FR') }}</td>
|
||||||
|
<td>{{ article.tags }}</td>
|
||||||
|
<td>{{`${article.online ? 'En ligne' : 'Hors ligne'}`}}</td>
|
||||||
|
<RouterLink :to="`articles/edit/${article.titleID}`">
|
||||||
|
Éditer
|
||||||
|
</RouterLink>
|
||||||
|
<button>Supprimer</button>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user