1
0
mirror of synced 2026-03-23 02:58:34 +08:00

feat(cli,data-source,editor,playground,runtime): 支持自定义数据源

This commit is contained in:
roymondchen
2023-08-21 16:57:18 +08:00
parent 60e14fe53e
commit 573f1a2c17
28 changed files with 528 additions and 269 deletions

View File

@@ -21,12 +21,14 @@ import ReactDOM from 'react-dom';
import { cloneDeep } from 'lodash-es';
import Core from '@tmagic/core';
import { DataSourceManager } from '@tmagic/data-source';
import type { MApp } from '@tmagic/schema';
import type { RemoveData, SortEventData, UpdateData } from '@tmagic/stage';
import { AppContent } from '@tmagic/ui-react';
import { replaceChildNode } from '@tmagic/utils';
import components from '../.tmagic/comp-entry';
import datasources from '../.tmagic/datasource-entry';
import plugins from '../.tmagic/plugin-entry';
import App from './App';
@@ -39,6 +41,10 @@ declare global {
}
}
Object.entries(datasources).forEach(([type, ds]: [string, any]) => {
DataSourceManager.registe(type, ds);
});
const app = new Core({
ua: window.navigator.userAgent,
platform: 'editor',