Skip to content

Commit 5ace9bd

Browse files
committed
2 parents 0316b5f + 24bcf9d commit 5ace9bd

File tree

10 files changed

+26
-21
lines changed

10 files changed

+26
-21
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
2-
*.tgz
2+
*.tgz
3+
.idea/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
examples/
2+
*.tgz
3+
.babelrc

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# restackx-core
32

43
前端快速开发框架,可适用与web及react-native。
@@ -108,6 +107,7 @@ restackx-core提供了路由的入口,导入指定路由可方便我们管理,
108107
npm i babel-plugin-transform-decorators-legacy babel-preset-react-native-stage-0 --save-dev
109108

110109
在 .babelrc 文件中配置 babel 插件:
110+
111111
112112
{
113113
'presets': ['react-native'],

examples/demo/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"prop-types": "^15.5.8",
2828
"react": "^15.5.4",
2929
"react-dom": "^15.5.4",
30-
"react-router": "^2.4.0",
31-
"restackx-core": "0.0.3"
30+
"react-router": "^4.1.0",
31+
"react-router-dom":"4.1.2",
32+
"restackx-core": "0.2.1"
3233
},
3334
"devDependencies": {
3435
"ansi-to-html-umd": "^0.4.2",
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import React,{Component} from 'react'
22
import { render } from 'react-dom'
3-
import { Router} from 'react-router'
43
import routes from './routes'
5-
import { browserHistory } from 'react-router'
6-
import Store from './store'
4+
import Store from './stores'
75
import {App} from 'restackx-core'
86

97
const container = document.getElementById('container');
108
render(
11-
<App store={Store} history={browserHistory} routes={routes}/>,
9+
<App store={Store} routes={routes}/>,
1210
container
1311
)
14-
//<IndexRoute component={App}/>
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import React from 'react';
2-
import {Route, IndexRoute} from 'react-router'
2+
import {Route, Switch} from 'react-router-dom'
33

44
import App from './demo/App';
55
import NewComponent from './demo/newcomponent'
66
import PageTwo from './demo/page2'
77

88
export default (
9-
<Route path="/" component={App}>
10-
<IndexRoute component={NewComponent}/>
11-
<Route path="pagetwo" component={PageTwo}/>
9+
<Route path="/">
10+
<App>
11+
<Switch>
12+
<Route exact path="/" component={NewComponent}/>
13+
<Route path="pagetwo" component={PageTwo}/>
14+
</Switch>
15+
</App>
1216
</Route>
1317
);

examples/demo/src/modules/store.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {observable, computed, reaction} from 'mobx'
2+
import {handleModels} from 'restackx-core'
3+
4+
const modelContext = require.context('../', true, /.store.js$/)
5+
var stores = handleModels(modelContext)
6+
7+
export default stores

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "restackx-core",
3-
"version": "0.1.1",
3+
"version": "0.2.1",
44
"description": "react and mobx application tools",
55
"main": "lib/index.js",
66
"react-native":"lib/native.js",

0 commit comments

Comments
 (0)