From 343ac29a570b43947cef4eebf4b948793f1c1ee0 Mon Sep 17 00:00:00 2001 From: Duong Truong Phong Date: Tue, 4 Jun 2024 09:40:30 +0700 Subject: [PATCH 1/2] phongdt:sort --- stores/dynamic-page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stores/dynamic-page.ts b/stores/dynamic-page.ts index 78f9665..14c8d0e 100644 --- a/stores/dynamic-page.ts +++ b/stores/dynamic-page.ts @@ -33,7 +33,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => { sectionPublished.value = currentPage.value.sections && currentPage.value.sections.filter( (section: any) => section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data) - ); + ).sort((a, b) => a.order - b.order); }; From 4d239e9f32d81937dc0d32aca5a4de0a36d9e409 Mon Sep 17 00:00:00 2001 From: MoreStrive Date: Tue, 4 Jun 2024 09:59:12 +0700 Subject: [PATCH 2/2] minhnt-dev: dynamic section --- pages/[categories]/index.vue | 2 +- stores/dynamic-page.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/[categories]/index.vue b/pages/[categories]/index.vue index 915198b..20d8ee4 100644 --- a/pages/[categories]/index.vue +++ b/pages/[categories]/index.vue @@ -26,7 +26,7 @@ watch(currentPage, () => { }, { deep: true }) useHead({ - title: currentPage.value.title || '' + title: () => currentPage.value.title || '' }) diff --git a/stores/dynamic-page.ts b/stores/dynamic-page.ts index 14c8d0e..6df74b8 100644 --- a/stores/dynamic-page.ts +++ b/stores/dynamic-page.ts @@ -33,7 +33,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => { sectionPublished.value = currentPage.value.sections && currentPage.value.sections.filter( (section: any) => section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data) - ).sort((a, b) => a.order - b.order); + ).sort((a: any, b: any) => a.order - b.order); };