HTML Editor go on

This commit is contained in:
Surya Paolo
2022-11-13 22:39:25 +01:00
parent 5076d72523
commit 711f1b515d
35 changed files with 3684 additions and 1663 deletions

View File

@@ -7,6 +7,7 @@ import { IMyElem, IMyPage } from '@src/model'
import { useGlobalStore } from '@store/globalStore'
import { LandingFooter } from '@/components/LandingFooter'
import { CMyElem } from '@/components/CMyElem'
import { CMyEditElem } from '@/components/CMyEditElem'
import { CImgTitle } from '../CImgTitle/index'
import { CTitle } from '../CTitle/index'
@@ -17,7 +18,7 @@ import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'CMyPageElem',
components: { LandingFooter, CImgTitle, CTitle, CMyElem },
components: { LandingFooter, CImgTitle, CTitle, CMyElem, CMyEditElem },
props: {
title: String,
mypath: {
@@ -61,6 +62,7 @@ export default defineComponent({
const editOn = ref(false)
const addOn = ref(false)
const selElem = ref({} as IMyElem)
const myelemVoid = ref({active: true, type: shared_consts.ELEMTYPE.TEXT, container: '...', path: mypathin.value} as IMyElem)
const globalStore = useGlobalStore()
@@ -76,6 +78,11 @@ export default defineComponent({
const load = async (): Promise<void> => {
// console.log('load', mypathin.value)
if (mypathin.value !== '') rec.value = await globalStore.loadPage('/' + mypathin.value)
editOn.value = tools.getCookie('EDIT_' + mypathin.value) === '-1' ? true : false
if (mypathin.value === 'home')
editOn.value = false
console.log('getcookie: ', editOn.value, mypathin.value)
}
watch(() => props.mypath, async (to: string, from: string) => {
@@ -84,6 +91,19 @@ export default defineComponent({
})
function selElemClick(myelem: IMyElem) {
selElem.value = myelem
}
function saveElem(myelem: IMyElem) {
//
}
function changeVisuDrawer() {
console.log('changeVisuDrawer')
tools.setCookie('EDIT_' + mypathin.value, editOn.value ? '-1' : '0')
}
onMounted(load)
return {
@@ -94,6 +114,10 @@ export default defineComponent({
tools,
shared_consts,
myelemVoid,
selElemClick,
selElem,
saveElem,
changeVisuDrawer,
}
},