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

fix(ui,runtime): 迭代器容器迭代数据兼容

re #613
This commit is contained in:
roymondchen
2024-05-31 14:45:21 +08:00
parent 7fb4d96cb0
commit 94db430b85
15 changed files with 175 additions and 153 deletions

View File

@@ -17,7 +17,7 @@
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import { cloneDeep } from 'lodash-es';
import Core from '@tmagic/core';
@@ -64,13 +64,13 @@ const updateConfig = (root: MApp) => {
};
const renderDom = () => {
ReactDOM.render(
const root = createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<AppContent.Provider value={app}>
<App />
</AppContent.Provider>
</React.StrictMode>,
document.getElementById('root'),
);
setTimeout(() => {
@@ -113,9 +113,9 @@ const operations = {
updateConfig(root);
},
update({ config, root, parentId}: UpdateData) {
update({ config, root, parentId }: UpdateData) {
const newNode = app.dataSourceManager?.compiledNode(config, undefined, true) || config;
replaceChildNode(newNode, [root], parentId);
replaceChildNode(newNode, [root], parentId);
updateConfig(cloneDeep(root));
},
@@ -131,7 +131,7 @@ const operations = {
Object.keys(components).forEach((type: string) => app.registerComponent(type, components[type]));
Object.values(plugins).forEach((plugin: any) => {
plugin.install(app);
plugin.install({ app });
});
// @ts-ignore