Version: 5.x
single-spa-riot
single-spa-riot is a helper library that helps implement single-spa registered application lifecycle functions (bootstrap, mount and unmount) for for use with riot. Check out the single-spa-riot github.
npm install --save single-spa-riot
import * as Riot from 'riot';
import singleSpaRiot from 'single-spa-riot';
import App from './App.riot'
const riotLifecycles = singleSpaRiot({
rootComponent: Riot.component(App),
domElementGetter: () => document.getElementById('#app')
});
export const bootstrap = riotLifecycles.bootstrap;
export const mount = riotLifecycles.mount;
export const unmount = riotLifecycles.unmount;
All options are passed to single-spa-riot via the opts
parameter when calling singleSpaRiot(opts)
. The following options are available:
domElementGetter
: (required) the callback to get root component mount element.rootComponent
: (optional and replacesappOptions.loadRootComponent
) the root riot component.loadRootComponent
: (optional and replacesappOptions.rootComponent
) A promise that resolves with your root component. This is useful for lazy loading.
当前内容版权归 single-spa 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 single-spa .