一键自动分包

Alita小程序的分包是比较简单的,假定有如下页面:


<Router>
    <Route key={"A"} component={A}/>
    <Route key={"B"} component={B}/>
    <Route key={"C"} component={C}/>
    <Route key={"D"} component={D}/>
    <Route key={"E"} component={E}/>
</Router>

如若想把B,C分为一个包, D, E分为一个包。

那么只需:


<Router>
    <Route key={"A"} component={A}/>
    <Route subpage="sp1" key={"B"} component={B}/>
    <Route subpage="sp1" key={"C"} component={C}/>
    <Route subpage="sp2" key={"D"} component={D}/>
    <Route subpage="sp2" key={"E"} component={E}/>
</Router>

注意: Tab页无论怎么配置subpage 都属于主包

results matching ""

    No results matching ""