forked from opentiny/tiny-engine
feat:引入第三方组件库element-plus部分组件示例 (#105)
* feat: 引入第三方组件库element-plus示例 * fix:修复格式错误 * feat:表格列配置组件 * feat:增加表格列配置组件 * fix:build error * fix:修复scheme2code接口报错 * fix:修改import顺序
This commit is contained in:
parent
422714e7a3
commit
a3b43ec166
File diff suppressed because it is too large
Load Diff
|
@ -84,7 +84,7 @@ export default class Schema2CodeServcice {
|
|||
return components.map((component) => {
|
||||
const {
|
||||
component: componentName,
|
||||
npm: { package: packageName, exportName, version, destructuring }
|
||||
npm: { package: packageName, exportName, version, destructuring } = {}
|
||||
} = component
|
||||
return {
|
||||
componentName,
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<template>
|
||||
<MetaArrayItem v-bind="$attrs" @update:modelValue="updateColumns"></MetaArrayItem>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick } from 'vue'
|
||||
import { updateRect } from '@opentiny/tiny-engine-canvas'
|
||||
import { useProperties, useResource } from '@opentiny/tiny-engine-controller'
|
||||
import MetaArrayItem from './MetaArrayItem.vue'
|
||||
|
||||
const { children: schemaChildren, componentName, props } = useProperties().getSchema()
|
||||
const configureMap = useResource().getConfigureMap()
|
||||
const childComponentName =
|
||||
configureMap[componentName]?.nestingRule?.childWhitelist?.[0] || schemaChildren?.[0]?.componentName
|
||||
|
||||
const updateColumns = (columns) => {
|
||||
if (!columns?.length) {
|
||||
return
|
||||
}
|
||||
|
||||
const children = columns.map((item) => {
|
||||
return {
|
||||
componentName: childComponentName,
|
||||
props: { ...item }
|
||||
}
|
||||
})
|
||||
|
||||
useProperties().getSchema().children = children
|
||||
nextTick(updateRect)
|
||||
}
|
||||
|
||||
updateColumns(props?.columns)
|
||||
</script>
|
|
@ -1,14 +1,14 @@
|
|||
/**
|
||||
* Copyright (c) 2023 - present TinyEngine Authors.
|
||||
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license.
|
||||
*
|
||||
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
||||
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
||||
*
|
||||
*/
|
||||
* Copyright (c) 2023 - present TinyEngine Authors.
|
||||
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license.
|
||||
*
|
||||
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
||||
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
||||
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
||||
*
|
||||
*/
|
||||
|
||||
import PluginSetting from './component/PluginSetting.vue'
|
||||
import PluginPanel from './component/PluginPanel.vue'
|
||||
|
@ -77,6 +77,7 @@ import MetaRelatedColumns from './component/MetaRelatedColumns.vue'
|
|||
import BlockDeployDialog from './component/BlockDeployDialog.vue'
|
||||
import ProgressBar from './component/ProgressBar.vue'
|
||||
import MetaButtonGroup from './component/MetaButtonGroup.vue'
|
||||
import MetaTableColumns from './component/MetaTableColumns.vue'
|
||||
|
||||
import i18n, { i18nKeyMaps } from './js/i18n.js'
|
||||
|
||||
|
@ -128,8 +129,8 @@ export const MetaComponents = {
|
|||
MetaCheckboxGroup,
|
||||
MetaIpSection,
|
||||
MetaRelatedEditor,
|
||||
MetaRelatedColumns
|
||||
|
||||
MetaRelatedColumns,
|
||||
MetaTableColumns
|
||||
}
|
||||
|
||||
export {
|
||||
|
@ -188,5 +189,6 @@ export {
|
|||
SaveNewBlock,
|
||||
BindI18n,
|
||||
BlockDeployDialog,
|
||||
ProgressBar
|
||||
ProgressBar,
|
||||
MetaTableColumns
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue