fix:走马灯属性配置清空标签页后添加标签页显示出错 (#23)

* fix:走马灯属性配置清空标签页后添加标签页显示出错

* fix: 优化走马灯删除标签页问题修复方案
This commit is contained in:
yaoyun8 2023-10-27 19:22:06 -07:00 committed by GitHub
parent 5819a9cab4
commit 25ecc86d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -22,7 +22,7 @@
<script>
import { ref } from 'vue'
import MetaListItems from './MetaListItems.vue'
import { useProperties, useHistory } from '@opentiny/tiny-engine-controller'
import { useProperties, useResource, useHistory } from '@opentiny/tiny-engine-controller'
import { utils } from '@opentiny/tiny-engine-utils'
import { iconDel } from '@opentiny/vue-icon'
@ -32,7 +32,10 @@ export default {
IconDel: iconDel()
},
setup() {
const schemaChildren = useProperties().getSchema().children
const { children: schemaChildren, componentName } = useProperties().getSchema()
const configureMap = useResource().getConfigureMap()
const childComponentName =
configureMap[componentName]?.nestingRule?.childWhitelist?.[0] || schemaChildren?.[0]?.componentName
schemaChildren.forEach((item) => {
if (!item.props) {
@ -48,7 +51,7 @@ export default {
const name = utils.guid()
schemaChildren.push({
componentName: schemaChildren?.[0]?.componentName,
componentName: childComponentName,
props: {
title: '选项卡',
name