diff --git a/packages/editor/src/Editor.vue b/packages/editor/src/Editor.vue
index 2088b772..9e6800b4 100644
--- a/packages/editor/src/Editor.vue
+++ b/packages/editor/src/Editor.vue
@@ -25,6 +25,10 @@
+
+
+
+
@@ -40,6 +44,10 @@
+
+
+
+
diff --git a/packages/editor/src/components/Tree.vue b/packages/editor/src/components/Tree.vue
index 740fb70e..e7f488a0 100644
--- a/packages/editor/src/components/Tree.vue
+++ b/packages/editor/src/components/Tree.vue
@@ -1,14 +1,19 @@
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
@@ -47,9 +52,11 @@ withDefaults(
data: TreeNodeData[];
nodeStatusMap: Map;
indent?: number;
+ emptyText?: string;
}>(),
{
indent: 0,
+ emptyText: '暂无数据',
},
);
diff --git a/packages/editor/src/layouts/sidebar/Sidebar.vue b/packages/editor/src/layouts/sidebar/Sidebar.vue
index 8b2b188c..db79ee25 100644
--- a/packages/editor/src/layouts/sidebar/Sidebar.vue
+++ b/packages/editor/src/layouts/sidebar/Sidebar.vue
@@ -64,6 +64,19 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/editor/src/layouts/sidebar/data-source/DataSourceList.vue b/packages/editor/src/layouts/sidebar/data-source/DataSourceList.vue
index 951f4d16..1bf54900 100644
--- a/packages/editor/src/layouts/sidebar/data-source/DataSourceList.vue
+++ b/packages/editor/src/layouts/sidebar/data-source/DataSourceList.vue
@@ -26,7 +26,7 @@
-
+
@@ -42,7 +42,9 @@ import { tMagicMessageBox, TMagicTooltip, TMagicTree } from '@tmagic/design';
import { Dep, Id } from '@tmagic/schema';
import Icon from '@editor/components/Icon.vue';
-import { DepTargetType, Services } from '@editor/type';
+import { type DataSourceListSlots, DepTargetType, type Services } from '@editor/type';
+
+defineSlots();
defineOptions({
name: 'MEditorDataSourceList',
diff --git a/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue
index 0430041d..3afe2bb7 100644
--- a/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue
+++ b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue
@@ -23,7 +23,11 @@
-
+
+
+
+
+
();
+
defineOptions({
name: 'MEditorDataSourceListPanel',
});
diff --git a/packages/editor/src/layouts/sidebar/layer/LayerPanel.vue b/packages/editor/src/layouts/sidebar/layer/LayerPanel.vue
index f4ff892e..6636b45b 100644
--- a/packages/editor/src/layouts/sidebar/layer/LayerPanel.vue
+++ b/packages/editor/src/layouts/sidebar/layer/LayerPanel.vue
@@ -19,7 +19,9 @@
@node-click="nodeClickHandler"
>
-
+
+
+
diff --git a/packages/editor/src/type.ts b/packages/editor/src/type.ts
index 8120b069..a4c45f1f 100644
--- a/packages/editor/src/type.ts
+++ b/packages/editor/src/type.ts
@@ -75,19 +75,25 @@ export interface CodeBlockListSlots {
'code-block-panel-tool'(props: { id: Id; data: CodeBlockContent }): any;
}
+export interface DataSourceListSlots {
+ 'data-source-panel-tool'(props: { data: any }): any;
+}
+
export interface LayerNodeSlots {
'layer-node-content'(props: { data: MNode }): any;
}
export interface LayerPanelSlots extends LayerNodeSlots {
'layer-panel-header'(props: {}): any;
+ 'layer-node-tool'(props: { data: MNode }): any;
+ 'layer-node-content'(props: { data: MNode }): any;
}
export interface PropsPanelSlots {
'props-panel-header'(props: {}): any;
}
-export type SidebarSlots = LayerPanelSlots & CodeBlockListPanelSlots & ComponentListPanelSlots;
+export type SidebarSlots = LayerPanelSlots & CodeBlockListPanelSlots & ComponentListPanelSlots & DataSourceListSlots;
export type BeforeAdd = (config: MNode, parent: MContainer) => Promise | MNode;
export type GetConfig = (config: FormConfig) => Promise | FormConfig;
@@ -614,4 +620,5 @@ export interface TreeNodeData {
id: Id;
name?: string;
items?: TreeNodeData[];
+ [key: string]: any;
}