提交一波,继续处理数据结构
This commit is contained in:
38
ui/dv/AiDvTabs.vue
Normal file
38
ui/dv/AiDvTabs.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<script>
|
||||
import AiDvRender from "./AiDvRender";
|
||||
|
||||
export default {
|
||||
name: "AiDvTabs",
|
||||
model: {
|
||||
prop: "active",
|
||||
event: "input"
|
||||
},
|
||||
props: {
|
||||
active: String,
|
||||
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) || []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="AiDvTabs">
|
||||
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="e"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AiDvTabs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user