Skip to content

Commit 46dc251

Browse files
committed
Update/.md
1 parent 9f2260f commit 46dc251

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed
Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,62 @@
1-
# restackx-core/ react-native
1+
# restackx-core
22

3-
restackx-core是一个前端快速开发框架,目前支持react-native。
3+
前端快速开发框架
44

5-
### 使用说明
5+
## restackx-core/ react
6+
7+
前端快速开发框架
8+
9+
#### 使用说明
10+
11+
>1. 创建自己的react 工程。[如何搭建 React Application](https://facebook.github.io/react/docs/installation.html)
12+
>
13+
>2. 安装依赖:` mobx, mobx-react` ` restackx-core`
14+
>
15+
>3. 配置入口文件(` index.js, routes.js, store,js`)。
16+
>
17+
18+
##### index.js:
19+
20+
import React,{Component} from 'react'
21+
import { render } from 'react-dom'
22+
import { Router} from 'react-router'
23+
import routes from './routes'
24+
import { browserHistory } from 'react-router'
25+
import Store from './store'
26+
import {App} from 'restackx-core'
27+
const container = document.getElementById('container');
28+
render(
29+
<App store={Store} history={browserHistory} routes={routes}/>,
30+
container
31+
)
32+
33+
##### routes.js:
34+
35+
import React from 'react';
36+
import {Route, IndexRoute} from 'react-router'
37+
import App from './demo/App';
38+
import NewComponent from './demo/newcomponent'
39+
import PageTwo from './demo/page2'
40+
export default (
41+
<Route path="/" component={App}>
42+
<IndexRoute component={NewComponent}/>
43+
<Route path="pagetwo" component={PageTwo}/>
44+
</Route>
45+
);
46+
47+
##### store.js:
48+
49+
import {observable, computed, reaction} from 'mobx'
50+
import {handleModels} from 'restackx-core'
51+
const modelContext = require.context('../', true, /.model.js$/)
52+
var models = handleModels(modelContext)
53+
export default models
54+
55+
## restackx-core/ react-native
56+
57+
restackx-core支持react-native。
58+
59+
#### 使用说明
660

761
>1. 创建自己的react-native工程(react-native init app)。[如何搭建RN工程](https://facebook.github.io/react-native/docs/getting-started.html)
862
>

0 commit comments

Comments
 (0)