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

45 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div>
<h1>محتوای لندینگ</h1>
<p class="muted">متن‌ها را مثل فرم معمولی ویرایش کنید — نیازی به کدنویسی نیست.</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>{{ label(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 TITLES: Record<string, string> = {
hero: "صفحه اول (هیرو)",
marquee: "نوار متحرک",
manifesto: "معرفی",
services: "خدمات",
work: "نمونه کارها",
process: "فرآیند کار",
stats: "آمار",
team: "تیم",
footer: "تماس و فوتر",
};
const sections = ref<any[]>([]);
function label(key: string) {
return TITLES[key] || key;
}
onMounted(async () => {
const { data } = await api.get("/admin/sections");
sections.value = data;
});
</script>