feat: add listen code change
This commit is contained in:
@@ -43,22 +43,25 @@ export const Deck = () => {
|
||||
const codes = nodes.map((node: any) => {
|
||||
const container = node.container;
|
||||
const data = container?.data || {};
|
||||
const nodeData = node.data || {};
|
||||
let style = nodeData.style ?? {
|
||||
position: 'absolute',
|
||||
width: 100,
|
||||
height: 100,
|
||||
};
|
||||
return {
|
||||
id: node.id,
|
||||
title: node.title,
|
||||
code: container?.code || '',
|
||||
data: data,
|
||||
children: node.children,
|
||||
...data, // style className shadowRoot showChild
|
||||
// TODO: style className shadowRoot showChild
|
||||
className: nodeData.className,
|
||||
shadowRoot: nodeData.shadowRoot,
|
||||
showChild: nodeData.showChild,
|
||||
style,
|
||||
};
|
||||
});
|
||||
// const code = {
|
||||
// id: data.id,
|
||||
// title: data.title,
|
||||
// code: data.code,
|
||||
// data: data.data,
|
||||
// };
|
||||
// init([code]);
|
||||
init(codes);
|
||||
console.log('codes', codes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user