weaver_trunk_cli/pc4mobx/esearch/single.js

41 lines
1.3 KiB
JavaScript
Raw Normal View History

2023-03-14 09:51:55 +08:00
import React from 'react';
import ReactDOM from 'react-dom';
import { createHashHistory } from 'History';
2024-05-15 16:50:21 +08:00
import { Router, Route, useRouterHistory } from 'react-router';
2023-03-14 09:51:55 +08:00
import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';
import { Provider } from 'mobx-react';
2024-05-15 16:50:21 +08:00
import ESearch from 'weaESearch' //umd
2023-03-14 09:51:55 +08:00
const routing = new RouterStore();
const allStore = {
routing,
2024-05-15 16:50:21 +08:00
...ESearch.store,
};
2023-03-14 09:51:55 +08:00
2024-05-15 16:50:21 +08:00
const signStore = {
routing,
store: { ...ESearch.store },
};
2023-03-14 09:51:55 +08:00
const browserHistory = useRouterHistory(createHashHistory)({
queryKey: '_key',
2024-05-15 16:50:21 +08:00
basename: '/',
2023-03-14 09:51:55 +08:00
});
const history = syncHistoryWithStore(browserHistory, allStore.routing);
const Home = props => props.children;
const Root = () => (
2024-05-15 16:50:21 +08:00
<Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@biss3l`} {...allStore}>
<Router ecId={`${this && this.props && this.props.ecId || ''}_Router@7qub25`} history={history}>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@0qj01y`} name='main' breadcrumbName='入口' path='/main' component={Home}>
{ ESearch.Route }
2023-03-14 09:51:55 +08:00
</Route>
</Router>
</Provider>
);
2024-05-15 16:50:21 +08:00
ReactDOM.render(<Root ecId={`${this && this.props && this.props.ecId || ''}_Root@v6euul`} />, document.getElementById('container'));
module.exports = ESearch;