refactoring

This commit is contained in:
2025-12-06 09:30:10 +02:00
parent f7955404a9
commit 7397c6dfe7
3 changed files with 22 additions and 19 deletions
+8 -8
View File
@@ -52,14 +52,6 @@ import AssetSelector from '../AssetsManagement/AssetSelector.vue';
export default { export default {
emits:['target', 'preview'], emits:['target', 'preview'],
components: { SvgIcon, AssetSelector }, components: { SvgIcon, AssetSelector },
data(){
return {
active: false
}
},
mounted(){
this.active = true;
},
props:{ props:{
//context: Object, //context: Object,
modelValue: Object, modelValue: Object,
@@ -69,6 +61,14 @@ export default {
visible: Boolean, visible: Boolean,
parent: Object parent: Object
}, },
data(){
return {
active: false
}
},
mounted(){
this.active = true;
},
steps: [['x1', 'y1']], steps: [['x1', 'y1']],
name: 'scene', name: 'scene',
modifiers: ['x1', 'y1'], modifiers: ['x1', 'y1'],
@@ -36,7 +36,8 @@
<v-btn :icon="expandDrawer ? 'mdi-arrow-expand-right' : 'mdi-arrow-expand-left'" variant="plain" size="x-small" density="compact" <v-btn :icon="expandDrawer ? 'mdi-arrow-expand-right' : 'mdi-arrow-expand-left'" variant="plain" size="x-small" density="compact"
@click="expandDrawer = !expandDrawer" v-if="selectedItem.length" class="position-absolute z-100 ma-1"></v-btn> @click="expandDrawer = !expandDrawer" v-if="selectedItem.length" class="position-absolute z-100 ma-1"></v-btn>
<template v-for="(item, i) in flatItems" :key="i"> <template v-for="(item, i) in flatItems" :key="i">
<component :is="components[item.__type]" :ref="`sc-${item.__path}`" :vd="item.vd" v-model="item.data" <component :is="components[item.__type]" :ref="`sc-${item.__path}`"
:vd="item.vd" v-model="item.data"
@target="setTarget($event, item)" @preview="preview" @target="setTarget($event, item)" @preview="preview"
:visible="item.visible" :cid="item.id" :parent="item.__parent" :visible="item.visible" :cid="item.id" :parent="item.__parent"
:selected="selectedItem.includes(item)"> :selected="selectedItem.includes(item)">
@@ -165,6 +166,8 @@ export default {
go.__type = 'GameObject'; go.__type = 'GameObject';
go.__path = `${i.__path}.go-${igo.toString().padStart(4, '0')}` go.__path = `${i.__path}.go-${igo.toString().padStart(4, '0')}`
go.__level = 2; go.__level = 2;
go.data.__root = this.object;
go.data.__this = go;
go.data.items?.forEach((t, it)=>{ go.data.items?.forEach((t, it)=>{
fi.push(t); fi.push(t);
t.__parent = go; t.__parent = go;
+8 -8
View File
@@ -32,14 +32,6 @@ import Utils from '@/lib/Utils';
export default { export default {
emits:['target', 'preview'], emits:['target', 'preview'],
components: { SvgIcon }, components: { SvgIcon },
data(){
return {
active: false
}
},
mounted(){
this.active = true;
},
props:{ props:{
//context: Object, //context: Object,
modelValue: Object, modelValue: Object,
@@ -49,6 +41,14 @@ export default {
visible: Boolean, visible: Boolean,
parent: Object parent: Object
}, },
data(){
return {
active: false
}
},
mounted(){
this.active = true;
},
computed:{ computed:{
showInView(){ showInView(){
this.vd.__showInView = this.visible && this.parent.visible && this.parent.__parent.visible; this.vd.__showInView = this.visible && this.parent.visible && this.parent.__parent.visible;