thainv: ghép navigation

This commit is contained in:
nguyen van thai
2024-06-17 11:48:00 +07:00
parent c2b9208746
commit 3c75c89a8b
30 changed files with 856 additions and 108 deletions
+4 -2
View File
@@ -871,6 +871,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
// "updatedOn": "2024-05-30T16:18:55.254121"
// })
currentPage.value = {}
console.log(currentPage.value, data.value, 'dynamic page')
currentPage.value = data.value
} catch (error: any) {}
}
@@ -895,18 +896,19 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
(section: any) => section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data)
).sort((a: any, b: any) => a.order - b.order);
console.log(sectionPublished.value, 'section');
console.log(sectionPublished.value, 'sections');
};
const setComponentPublished = () => {
const exsitsTemplate = ['None']
const contentArr: any = [];
currentPage.value.sections && currentPage.value.sections.map((section: any) => {
contentArr.push(section.content && JSON.parse(section.content) && JSON.parse(section.content));
return section;
});
componentPublished.value = currentPage.value.components && currentPage.value.components.filter((section: any) => section.isPublished);
console.log(componentPublished.value ,'123123')
console.log(currentPage.value.components ,'components 2')
};
const setDataQuery = (query: any, componentId: number | string) => {