minhnt-dev: footer

This commit is contained in:
MoreStrive
2024-06-19 16:13:42 +07:00
parent 3b613faccf
commit 229155b24a
6 changed files with 45 additions and 35 deletions
+2 -6
View File
@@ -871,7 +871,6 @@ 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) {}
}
@@ -885,6 +884,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
}
const setSectionPublished = () => {
const exsitsTemplate = ['None']
const contentArr: any = [];
currentPage.value.sections && currentPage.value.sections.map((section: any) => {
contentArr.push(section.content && typeof section.content === 'string' && JSON.parse(section.content));
@@ -893,11 +893,8 @@ 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)
(section: any) => exsitsTemplate.includes(section.settings?.template) && 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, 'sections');
};
const setComponentPublished = () => {
@@ -908,7 +905,6 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
return section;
});
componentPublished.value = currentPage.value.components && currentPage.value.components.filter((section: any) => section.isPublished);
console.log(currentPage.value.components ,'components 2')
};
const setDataQuery = (query: any, componentId: number | string) => {