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

@@ -254,7 +254,7 @@ export default defineComponent({
*/ */
watch(locale, (val, oldval) => { watch(() => locale, (val, oldval) => {
updateFormatters() updateFormatters()
}) })

View File

@@ -34,7 +34,7 @@ export default defineComponent({
// console.log('myimgint', this.myimgint) // console.log('myimgint', this.myimgint)
} }
watch( watch(() =>
imgprofile, imgprofile,
// @ts-ignore // @ts-ignore
(value: string, oldValue: string) => { (value: string, oldValue: string) => {
@@ -44,8 +44,10 @@ export default defineComponent({
) )
watch( watch(() =>
myimgvar, (value: string, oldValue: string) => { myimgvar,
// @ts-ignore
(value: string, oldValue: string) => {
myimgint.value = '' myimgint.value = ''
refresh() refresh()
}, },

View File

@@ -1,5 +1,5 @@
import { import {
defineComponent, onMounted, ref, toRef, defineComponent, onMounted, ref, toRef, watch,
} from 'vue' } from 'vue'
import { IMyPage } from '@src/model' import { IMyPage } from '@src/model'
@@ -53,9 +53,18 @@ export default defineComponent({
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
const load = async (): Promise<void> => { 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 } return { rec }
}, },

View File

@@ -31,7 +31,7 @@ export default defineComponent({
return getOperatorByUsername(props.username) return getOperatorByUsername(props.username)
}) })
watch(showuserdetails, (value: any, old: any) => { watch(() => showuserdetails, (value: any, old: any) => {
if (!showuserdetails.value) { if (!showuserdetails.value) {
globalStore.autoplaydisc = autoplaydiscsaved.value globalStore.autoplaydisc = autoplaydiscsaved.value
} }

View File

@@ -204,7 +204,7 @@ export default defineComponent({
}, },
}) })
watch( watch(() =>
stateconn, stateconn,
// @ts-ignore // @ts-ignore
(value: string, oldValue: string) => { (value: string, oldValue: string) => {

View File

@@ -19,14 +19,16 @@ export default defineComponent({
const { setmeta } = MixinMetaTags() const { setmeta } = MixinMetaTags()
async function created() { async function created() {
console.log('MyPage created')
rec.value = await globalStore.loadPage(route.path) rec.value = await globalStore.loadPage(route.path)
// console.log('MyPage created', rec.value)
// console.log('mounted', this.rec) // console.log('mounted', this.rec)
} }
watch(path, async (to: string, from: string) => { watch(path, async (to: string, from: string) => {
// console.log('watch path', path)
rec.value = await globalStore.loadPage(to) rec.value = await globalStore.loadPage(to)
// console.log('path change', rec.value)
}) })
function meta() { function meta() {

View File

@@ -1,8 +1,10 @@
<template> <template>
<div v-if="isfinishLoading"> <div v-if="isfinishLoading && !!rec">
<CMyPage <CMyPage
:title="rec.title" :imgbackground="`` + rec.imgback" :title="rec.title" :imgbackground="`` + rec.imgback"
:mypath="rec.path"
:sizes="`max-height: ` + rec.heightimg + `px`"> :sizes="`max-height: ` + rec.heightimg + `px`">
<span>{{ <span>{{
setmeta({ setmeta({
title: rec.title, title: rec.title,
@@ -12,31 +14,6 @@
}} }}
</span> </span>
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<div v-if="!!rec.img1" class="text-center">
<q-img :src="rec.img1" class="img"></q-img>
</div>
<div v-if="!!rec.content" v-html="rec.content"></div>
<q-video v-if="!!rec.video1" :src="rec.video1" :ratio="rec.ratio1">
</q-video>
<div v-if="!!rec.img2" class="text-center">
<q-img :src="rec.img2" class="img"></q-img>
</div>
<div v-if="!!rec.content2" v-html="rec.content2"></div>
<q-video v-if="!!rec.video2" :src="rec.video2" :ratio="rec.ratio2"></q-video>
<div v-if="!!rec.img3" class="text-center">
<q-img :src="rec.img2" class="img"></q-img>
</div>
<div v-if="!!rec.content3" v-html="rec.content3"></div>
<q-video v-if="!!rec.video3" :src="rec.video3" :ratio="rec.ratio3"></q-video>
<div v-if="!!rec.content4" v-html="rec.content4"></div>
</div>
</CMyPage> </CMyPage>
</div> </div>
</template> </template>