0.2.3 • Published 2 years ago

@micro-web/sub v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@micro-web/sub

NPM version Downloads Minified size Gzip size

@micro-web/app 微应用解决方案 子应用定义

安装

pnpm i @micro-web/sub

使用

import { defineMicroApp } from '@micro-web/sub';
import App, { AppProps } from './App';

export default defineMicroApp((container) => {
  function render(props: AppProps) {
    ReactDOM.render(<App {...props} />, container);
  }
  return {
    mount: render,
    render: render,
    unmount() {
      ReactDOM.unmountComponentAtNode(container);
    },
  };
});

defineMicroApp

需配合插件 @micro-web/vite-plugin。其主要作用将 CSS 通过 link 标签插入到主应用的动态节点上。

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago