Skip to content

Commit

Permalink
add dynamic title for all page
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisakhanzadi committed Apr 2, 2024
1 parent 45dbc53 commit bd965de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions frontend/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
if (useCookie("jwt")) {
const cookie = useState('cookie' , () => useCookie("jwt"))
}
useHead({
titleTemplate:(title)=>{
return title ? ` طرح چه | ${ title } ` : "طرح چه"
}
})
</script>

<template>
Expand Down
9 changes: 6 additions & 3 deletions frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {useHomePage} from "~/store/homePage";
const store = useHomePage()
store.fetchData()
const data = computed(()=> store.getData)
const data = computed(() => store.getData)
useHead({
title: "صفحه اصلی"
})
</script>

<template>
Expand All @@ -18,7 +20,8 @@ const data = computed(()=> store.getData)
<div class="col-md-8">
<h5 class="fw-bold spanborder"><span>جدیدترین‌ ها</span></h5>
<template v-if="data.all.length" v-for="{uuid, cover, title, excerpt, published_at} in data.all">
<CardMedium :cover="cover" :href="`/articles/${uuid}`" :title="title" :excerpt="excerpt" :publishedAt="published_at"/>
<CardMedium :cover="cover" :href="`/articles/${uuid}`" :title="title" :excerpt="excerpt"
:publishedAt="published_at"/>
</template>
<p v-else class="alert alert-info">No data!</p>
</div>
Expand Down

0 comments on commit bd965de

Please sign in to comment.