File tree Expand file tree Collapse file tree 1 file changed +14
-21
lines changed
Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,13 @@ restackx-core提供了路由的入口,导入指定路由可方便我们管理,
6868[ 如何搭建react-native工程] ( https://facebook.github.io/react-native/docs/getting-started.html )
6969
7070#### store
71- import HomePageModel from './models/HomePage.model';
72- import MenuBarModel from './models/MenuBar.model';
73- //这里添加所要导入的xxx.model.js
74- const store = {
75- "HomePage" : new HomePageModel(),
76- "MenuBarModel" : new MenuBarModel(),
71+ import Launch from './models/launch.model';
72+ const models = {
73+ "launch" : new Launch(),
74+
7775 }
76+ export default models;
77+
7878
7979#### router
8080 在restackx-core/react-native中使用的是NativeRouter,它这是为native提供了相应的路由。
@@ -83,22 +83,15 @@ restackx-core提供了路由的入口,导入指定路由可方便我们管理,
8383#### routes
8484在native app中route并不存在,而是通过导航来管理界面。想要是native实现route的功能可使用react-router-native,routes的具体管理:
8585
86- var route = [
87- {
88- "title":"Home",
89- "path":"/",
90- },{
91- "title":"Message",
92- "path":"/Message",
93- }] ;
9486 const Routes = (
95- <View style ={{flex :1 }} >
96- <NavBar />
97- <Route exact path ={route[0].path} component ={HomePage}/ >
98- <Route path ={route[1].path} component ={Message}/ >
99- <MenuBar routes ={route} initRoute ={route[0]}/ >
100- </View >
101- );
87+ <View style ={{flex :1 }} >
88+ <Switch >
89+ <Route exact path =" / " component ={LaunchPage}/ >
90+ <Route path =" /app " component ={App}/ >
91+ <Route path =" /main " component ={Main}/ >
92+ </Switch >
93+ </View >
94+ );
10295
10396
10497#### 注意:
You can’t perform that action at this time.
0 commit comments