CPage sistemata

This commit is contained in:
Paolo Arena
2021-10-03 15:09:17 +02:00
parent d0bfd3c33f
commit df4b4825e8
7 changed files with 34 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
import {
defineComponent, onMounted, ref, toRef,
defineComponent, onMounted, ref, toRef, watch,
} from 'vue'
import { IMyPage } from '@src/model'
@@ -53,9 +53,18 @@ export default defineComponent({
const globalStore = useGlobalStore()
const load = async (): Promise<void> => {
if (mypath.value !== '') rec.value = await globalStore.loadPage(mypath.value)
// console.log('load', mypath.value)
if (mypath.value !== '') rec.value = await globalStore.loadPage('/'+mypath.value)
}
onMounted(load)
watch(() => props.mypath, async (to: string, from: string) => {
// console.log('load', mypath.value)
if (mypath.value !== '') rec.value = await globalStore.loadPage('/'+mypath.value)
})
// onMounted(load)
load()
return { rec }
},