Skip to content
This repository was archived by the owner on Jan 29, 2021. It is now read-only.

Commit fe9e64e

Browse files
author
lawler61
committed
[update] 配置好 ts 编程并搭建好 mobx 架构, 实现自动注入 store 和 action
1 parent 9f513ef commit fe9e64e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1749
-276
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"import",
2626
{
2727
"libraryName": "antd-mobile",
28-
"style": true
28+
"style": "css"
2929
}
3030
],
3131
[

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ build
33
dist
44
config
55
server
6+
app/mobx
7+
app/tools

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"no-use-before-define": [
5555
"error",
5656
{
57-
"functions": true,
58-
"classes": true
57+
"functions": false,
58+
"classes": false
5959
}
6060
],
6161
"no-console": "off",

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
.idea
66
.project
77

8+
# vscode
9+
.vscode
10+
811
# npm
912
node_modules
1013
npm-debug.log

app/App.hot.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

app/App.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

app/App.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import * as React from 'react'
2+
import { hot } from 'react-hot-loader'
3+
import { configure } from 'mobx'
4+
import { provider } from './mobx/provider'
5+
import routes from './routes'
6+
import './mobxDependence';
7+
8+
configure({ enforceActions: 'observed' }) // 不允许在动作外部修改状态
9+
10+
@provider
11+
class App extends React.Component {
12+
render() {
13+
return <div>{routes}</div>
14+
}
15+
}
16+
17+
export default hot(module)(() => <App />)
File renamed without changes.
File renamed without changes.

app/assets/images/ruiwen.gif

38.6 KB
Loading

0 commit comments

Comments
 (0)