phongdt:header footer

This commit is contained in:
Duong Truong Phong
2024-05-30 22:57:45 +07:00
parent dd09434deb
commit 3b435e22ea
18 changed files with 787 additions and 467 deletions
+24
View File
@@ -0,0 +1,24 @@
import { defineStore, acceptHMRUpdate } from 'pinia'
export const useNavigationStoreV2 = defineStore('navigation-v2', () => {
const topMenu = ref('')
async function fetchNavigation() {
const {data, error } = await useFetch('/api/services/navigation')
if (error.value) {
return ''
}
if(data.value) {
topMenu.value = data.value
}
return topMenu.value
}
return {topMenu, fetchNavigation}
})
if (import.meta.hot) {
import.meta.hot.accept(acceptHMRUpdate(useNavigationStoreV2, import.meta.hot))
}