mns
/
urna
forked from mns/mini-skamja
4
0
Fork 0
This commit is contained in:
Kseninia Mikhaylova 2025-03-13 12:29:27 +03:00
parent 97eec04543
commit 9e447e4c9a
3 changed files with 12 additions and 12 deletions

View File

@ -6,7 +6,7 @@ const { fetchData } = useApiFetch()
import type { NuxtError } from '#app' import type { NuxtError } from '#app'
import og_img from '/og_img.png' import og_img from '/og_img.png'
const { data: seoData } = await fetchData<ApiKpType>(`kp/2/`) const { data: seoData } = await fetchData<Seo>(`kp/2/`)
useSeoMeta({ useSeoMeta({
title: seoData.value?.title, title: seoData.value?.title,

2
index.d.ts vendored
View File

@ -3,7 +3,7 @@ declare module '*.glb' {
export default src export default src
} }
type ApiKpType = { type Seo = {
id: number id: number
title: string title: string
content: string content: string

View File

@ -7,16 +7,16 @@ import { marked } from 'marked';
import og_img from '/og_img.png' import og_img from '/og_img.png'
// const { data: seoData } = await apiFetch<ApiKpType>(`kp/1/`) const { data: seo } = await fetchData<Seo[]>(`seo/`)
// useSeoMeta({ useSeoMeta({
// title: seoData.value?.title, title: seo.value && seo.value[0].title,
// ogTitle: seoData.value?.title, ogTitle: seo.value && seo.value[0].title,
// description: seoData.value?.content, description: seo.value && seo.value[0].content,
// ogDescription: seoData.value?.content, ogDescription: seo.value && seo.value[0].content,
// ogImage: config.public.baseUrl + og_img, ogImage: config.public.baseUrl + og_img,
// // twitterCard: 'summary_large_image', })
// })
const { data, status, error } = await fetchData<Menu[]>(`menu/`) const { data } = await fetchData<Menu[]>(`menu/`)
const pages = computed(() => { const pages = computed(() => {
const menu = data.value?.find(el => el.type == 1) const menu = data.value?.find(el => el.type == 1)
return (menu?.pages || []).sort((a, b) => a.order - b.order) return (menu?.pages || []).sort((a, b) => a.order - b.order)