Files
Montech_Landing/apps/adm/src/views/SectionsView.vue
T

30 lines
835 B
Vue
Raw Normal View History

<template>
<div>
<h1>محتوای لندینگ</h1>
<p class="muted">هر بخش JSON ساخت‌یافته دارد.</p>
<table class="table">
<thead>
<tr><th>کلید</th><th>آخرین ویرایش</th><th></th></tr>
</thead>
<tbody>
<tr v-for="s in sections" :key="s.id">
<td>{{ s.key }}</td>
<td class="muted">{{ new Date(s.updatedAt).toLocaleString("fa-IR") }}</td>
<td><RouterLink :to="`/sections/${s.key}`">ویرایش</RouterLink></td>
</tr>
</tbody>
</table>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { api } from "../lib/api";
const sections = ref<any[]>([]);
onMounted(async () => {
const { data } = await api.get("/admin/sections");
sections.value = data;
});
</script>