thainv-dev: fix ui

This commit is contained in:
nguyen van thai
2024-06-03 21:53:23 +07:00
parent d95d648687
commit 58b5c67d0c
7 changed files with 87 additions and 40 deletions
+17 -1
View File
@@ -1,9 +1,11 @@
import { defineStore, acceptHMRUpdate } from "pinia";
import { useLocalStorage } from "@vueuse/core";
export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
const currentPage = ref<any>({});
const sectionPublished = ref<any[]>([]);
const componentPublished = ref<any[]>([]);
const step = ref<number>(0)
async function fetchPageByCode(slug: any) {
try {
@@ -61,16 +63,30 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
setComponentPublished();
};
function increaseStep(increase: number) {
step.value += increase
return step.value
}
function decreaseStep(decrease: number) {
step.value -= decrease
return step.value
}
return {
currentPage,
sectionPublished,
componentPublished,
step,
fetchPageByCode,
fetchPageById,
setSectionPublished,
setComponentPublished,
setDataQuery,
increaseStep,
decreaseStep,
};
});