43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import { createHashHistory } from 'history';
|
|
import { Router, Route, useRouterHistory } from 'react-router';
|
|
import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';
|
|
import { Provider } from 'mobx-react';
|
|
import { WeaDebugRouteMenu } from 'ecCom';
|
|
import { WeaLicense, WeaLicenseSubmit, WeaPlugin, WeaNonStandard, WeaSystemSetting, WeaVersion, WeaLoginPop } from './index';
|
|
|
|
const routing = new RouterStore();
|
|
const allStore = { routing };
|
|
|
|
const browserHistory = useRouterHistory(createHashHistory)({
|
|
queryKey: '_key',
|
|
basename: '/',
|
|
});
|
|
|
|
const history = syncHistoryWithStore(browserHistory, routing);
|
|
|
|
window.weaHistory = history;
|
|
|
|
class Root extends React.Component {
|
|
render() {
|
|
return (
|
|
<Provider {...allStore}>
|
|
<Router history={history}>
|
|
<Route path="/" component={WeaDebugRouteMenu}>
|
|
<Route path="license" component={WeaLicense} />
|
|
<Route path="licensesubmit" component={WeaLicenseSubmit} />
|
|
<Route path="plugin" component={WeaPlugin} />
|
|
<Route path="nonstandard" component={WeaNonStandard} />
|
|
<Route path="systemsetting" component={WeaSystemSetting} />
|
|
<Route path="version" component={WeaVersion} />
|
|
<Route path="loginpop" component={WeaLoginPop} />
|
|
</Route>
|
|
</Router>
|
|
</Provider>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<Root />, document.getElementById('container'));
|