jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
15 lines (14 loc) • 794 B
TypeScript
import type { IScopedContext, RendererEnv } from 'jamis-core';
import type { AppSchema, PageSchema } from '../types';
export declare function embed(container: string | HTMLElement, schema: AppSchema | PageSchema, props?: any, envParam?: Partial<RendererEnv>): Promise<IScopedContext & {
/**
* 需要传递完整的props来从最顶层重新渲染, 低效且容易出bug
* @deprecated 不推荐使用, 使用rootRenderer.props.store对应的方法来更新页面(setPages), 更新location(updateLocation), 更新数据域(setData)
*/
updateProps: (props: Record<string, any>, callback?: () => void) => void;
/**
* 更新schema和props
*/
updateSchema: (newSchema: AppSchema | PageSchema, props: Record<string, any>) => void;
unmount: () => void;
}>;