mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-03-13 18:16:49 +08:00
change hook didDomUpdate name
This commit is contained in:
parent
405a46dcef
commit
ba25194287
@ -50,11 +50,11 @@ export function initSunmaoUIEditor(props: SunmaoUIEditorProps = {}) {
|
||||
const didUpdate = () => {
|
||||
eventBus.send('HTMLElementsUpdated');
|
||||
};
|
||||
const didHtmlUpdate = () => {
|
||||
const didDomUpdate = () => {
|
||||
eventBus.send('HTMLElementsUpdated');
|
||||
};
|
||||
|
||||
const ui = initSunmaoUI({ ...props.runtimeProps, hooks: { didMount, didUpdate, didHtmlUpdate } });
|
||||
const ui = initSunmaoUI({ ...props.runtimeProps, hooks: { didMount, didUpdate, didDomUpdate } });
|
||||
|
||||
const App = ui.App;
|
||||
const registry = ui.registry;
|
||||
|
@ -20,7 +20,7 @@ const _ImplWrapper = React.forwardRef<HTMLDivElement, ImplWrapperProps>((props,
|
||||
const eleRef = useRef<HTMLElement>();
|
||||
const onRef = (ele: HTMLElement) => {
|
||||
eleMap.set(c.id, ele);
|
||||
hooks?.didHtmlUpdate && hooks?.didHtmlUpdate();
|
||||
hooks?.didDomUpdate && hooks?.didDomUpdate();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -35,6 +35,6 @@ export type AppHooks = {
|
||||
didMount?: () => void;
|
||||
// app updates after schema changes
|
||||
didUpdate?: () => void;
|
||||
// app updates after html elements change
|
||||
didHtmlUpdate?: () => void;
|
||||
// app updates after dom change(dose not include updates from schema change)
|
||||
didDomUpdate?: () => void;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user