-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (33 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict'
/**
* Created by weiChow on 2020/06/30
* React、ReactDOM、RootRouter、Redux
*/
import React from 'react'
import ReactDOM from 'react-dom'
import RootRouter from '@/router/index' // 路由入口
import { Provider } from 'react-redux'
import 'animate.css' // 动画效果
import '@/style/main.less' // 主框架样式
import { ConfigProvider } from 'antd'
import zhCN from 'antd/es/locale/zh_CN' // 国际化(中文)
import registerStore from '@/store/registerStore'
import systemConfig from '@/config/systemConfig'
if (module.hot) {
module.hot.accept()
}
// 创建store
const context = require.context('@/model', true, /\.js$/)
const store = registerStore()
.useModel(context.keys().map(key => context(key).default))
.run()
// 系统名
document.title = systemConfig.PGIS_SYSCONFIG.system.title
const rootContainer = (
<Provider {...{ store }}>
<ConfigProvider locale={zhCN}>
<RootRouter />
</ConfigProvider>
</Provider>
)
ReactDOM.render(rootContainer, document.getElementById('root'))