fix(editor): slot修改,schema声明修改

This commit is contained in:
parisma 2022-09-27 15:14:35 +08:00 committed by jia000
parent 85951de24d
commit 0baec3e532
6 changed files with 12 additions and 10 deletions

View File

@ -27,8 +27,8 @@
<slot name="code-block-panel-header"></slot>
</template>
<template #code-block-panel-tool="{ id }">
<slot name="code-block-panel-tool" :id="id"></slot>
<template #code-block-panel-tool="{ id, data }">
<slot name="code-block-panel-tool" :id="id" :data="data"></slot>
</template>
<template #code-block-edit-panel-header="{ id }">

View File

@ -27,8 +27,8 @@
<slot name="code-block-panel-header"></slot>
</template>
<template #code-block-panel-tool="{ id }" v-if="item === 'code-block'">
<slot name="code-block-panel-tool" :id="id"></slot>
<template #code-block-panel-tool="{ id, data }" v-if="item === 'code-block'">
<slot name="code-block-panel-tool" :id="id" :data="data"></slot>
</template>
<template #code-block-edit-panel-header="{ id }" v-if="item === 'code-block'">

View File

@ -35,8 +35,8 @@
<component v-else-if="config.slots?.codeBlockPanelHeader" :is="config.slots.codeBlockPanelHeader" />
</template>
<template #code-block-panel-tool="{ id }" v-if="data === 'code-block' || config.slots?.codeBlockPanelTool">
<slot v-if="data === 'code-block'" name="code-block-panel-tool" :id="id"></slot>
<template #code-block-panel-tool="{ id, data }" v-if="data === 'code-block' || config.slots?.codeBlockPanelTool">
<slot v-if="data === 'code-block'" name="code-block-panel-tool" :id="id" :data="data"></slot>
<component v-else-if="config.slots?.codeBlockPanelTool" :is="config.slots.codeBlockPanelTool" />
</template>

View File

@ -47,7 +47,7 @@
<el-tooltip effect="dark" content="删除" placement="bottom" v-if="editable">
<Icon :icon="Close" class="edit-icon" @click.stop="deleteCode(`${data.id}`)"></Icon>
</el-tooltip>
<slot name="code-block-panel-tool" :id="data.id"></slot>
<slot name="code-block-panel-tool" :id="data.id" :data="data.codeBlockContent"></slot>
</div>
</div>
<!-- 展示代码块下绑定的组件 -->
@ -148,7 +148,7 @@ const initList = async () => {
state.codeList.push({
id: codeId,
name: value.name,
content: value.content,
codeBlockContent: value,
showRelation: true,
});
});

View File

@ -358,7 +358,7 @@ export interface CodeDslList {
/** 代码块名称 */
name: string;
/** 代码块函数内容 */
content: any;
codeBlockContent: CodeBlockContent;
/** 是否展示代码绑定关系 */
showRelation?: boolean;
}
@ -374,6 +374,8 @@ export interface ListRelationState extends ListState {
/** 代码块id : 组件信息 */
[id: string]: MNode[];
};
/** codeDsl内容用于暴露给业务方 */
// codeDsl: CodeBlockDSL | null;
}
export enum CodeDeleteErrorType {

View File

@ -69,7 +69,7 @@ export interface MApp extends MComponent {
/** */
items: MPage[];
/** 代码块 */
method: CodeBlockDSL;
codeBlocks?: CodeBlockDSL;
}
export interface CodeBlockDSL {