mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-08-27 18:25:35 +08:00
refactor(editor): 导出ErrorType类型以便业务方使用
This commit is contained in:
parent
c3b502254b
commit
ff3adbb1d0
@ -61,15 +61,10 @@ import { flattenDeep, forIn, isEmpty, values } from 'lodash-es';
|
||||
|
||||
import Icon from '../../../components/Icon.vue';
|
||||
import type { CodeBlockContent, Services } from '../../../type';
|
||||
import { CodeDslList, EditorMode, ListState } from '../../../type';
|
||||
import { CodeDslList, EditorMode, ErrorType, ListState } from '../../../type';
|
||||
|
||||
import codeBlockEditor from './CodeBlockEditor.vue';
|
||||
|
||||
enum ErrorType {
|
||||
UNDELETEABLE = 'undeleteable',
|
||||
BIND = 'bind',
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
customError?: (id: string, errorType: ErrorType) => any;
|
||||
}>();
|
||||
|
@ -346,14 +346,26 @@ export enum EditorMode {
|
||||
}
|
||||
|
||||
export type CompRelation = {
|
||||
/** 代码块绑定关系:组件id-代码块id数组 */
|
||||
[compId: string | number]: string[];
|
||||
};
|
||||
|
||||
export interface CodeDslList {
|
||||
/** 代码块id */
|
||||
id: string;
|
||||
/** 代码块名称 */
|
||||
name: string;
|
||||
/** 代码块函数内容 */
|
||||
content: any;
|
||||
}
|
||||
export interface ListState {
|
||||
/** 代码块列表 */
|
||||
codeList: CodeDslList[];
|
||||
}
|
||||
|
||||
export enum ErrorType {
|
||||
/** 代码块存在于不可删除列表中 */
|
||||
UNDELETEABLE = 'undeleteable',
|
||||
/** 代码块存在绑定关系 */
|
||||
BIND = 'bind',
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user