thainv-dev: page chi tiết

This commit is contained in:
nguyen van thai
2024-05-31 12:39:53 +07:00
parent 86bebfd66e
commit 6ff759f22a
15 changed files with 348 additions and 14 deletions
+5 -1
View File
@@ -27,10 +27,13 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
contentArr.push(section.content && typeof section.content === 'string' && JSON.parse(section.content));
return section;
});
console.log(currentPage.value.sections ,'sectionPublished 2')
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)
);
console.log(sectionPublished.value ,'sectionPublished')
};
const setComponentPublished = () => {
@@ -40,7 +43,8 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
return section;
});
componentPublished.value = currentPage.value.components && currentPage.value.components.filter((section: any) => section.isPublished);
};
console.log(componentPublished.value, 'componentPublished2')
};
const setDataQuery = (query: any, componentId: number | string) => {
for (const _component of currentPage.value.components && currentPage.value.components) {