大概可以看的一版
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<script>
|
||||
import AiDvRender from "./AiDvRender";
|
||||
|
||||
export default {
|
||||
name: "AiDvTabs",
|
||||
model: {
|
||||
@@ -12,12 +10,17 @@ export default {
|
||||
config: Object,
|
||||
values: Object
|
||||
},
|
||||
components: {AiDvRender},
|
||||
computed: {
|
||||
layers: v => {
|
||||
const tab = v.config?.tabs[v.active]
|
||||
const values = v.values[tab.label]
|
||||
return tab.comps?.map(e => ({dataType: "staticData", ...e, staticData: values[e.label]}))?.filter(e => e.type) || []
|
||||
layers: {
|
||||
set(settings) {
|
||||
console.log(settings)
|
||||
},
|
||||
get() {
|
||||
const v = this
|
||||
const tab = v.config?.tabs[v.active]
|
||||
const values = v.values[tab.label]?.data || {}
|
||||
return tab.comps?.map(e => ({dataType: "staticData", ...e, staticData: Array.isArray(values) ? values : values[e.label]}))?.filter(e => e.type) || []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +28,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<section class="AiDvTabs">
|
||||
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="e"/>
|
||||
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="layers[i]" :index="i"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -33,6 +36,7 @@ export default {
|
||||
.AiDvTabs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px
|
||||
gap: 16px;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user