Closed slowlyo closed 1 year ago
<Switch location={location}> {flattenRoutes.map(({path, component}, index) => { return <Route key={index} path={path} render={() => ( <KeepAlive name={path} cacheKey={path} when={settings.keepAlive && appSettings.layout?.keep_alive_exclude.indexOf(path) == -1}> {React.createElement(component)} </KeepAlive> )}/> })} <Route exact path="/"> <Redirect to={`/${defaultRoute}`}/> </Route> {flattenRoutes.length && ( <Route path="*" component={lazyLoad(() => import("@/pages/exception/403"))} /> )} </Switch>
如果我使用 KeepAlive 组件把我的组件包裹起来, build后就会报错~ 运行时一切正常
KeepAlive
其他原因~ 已解决
问题代码
描述
如果我使用
KeepAlive
组件把我的组件包裹起来, build后就会报错~ 运行时一切正常