0 Star 0 Fork 53

zhoupan/DotaVideo

forked from 0-hun/DotaVideo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
0-hun 提交于 2016-04-16 18:46 . 添加排行筛选
'use strict';
var React = require('react-native');
import Home from './app/tpl/home';
import TopList from './app/tpl/topList';
import Users from './app/tpl/users';
import UserVideo from './app/tpl/userVideos';
import Video from './app/tpl/video';
import Main from './app/common/Main';
var {
Navigator,
} = React;
var App = React.createClass({
renderScene(router, navigator){
var Component = null;this._navigator = navigator;
switch(router.name){
case "Home":
Component = Home;
break;
case "TopList":
Component = TopList;
break;
case "Users":
Component = Users;
break;
case "UserVideo":
Component = UserVideo;
break;
case "Video":
Component = Video;
break;
default: //default view
Component = Home;
}
return <Component navigator={navigator} {...router.passProps}/>
},
componentWillMount:function(){
},
_render:function(){
return (
<Navigator
initialRoute={{name: 'Home'}}
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {
return route.sceneConfig;
}
return Navigator.SceneConfigs.FadeAndroid;
}}
/>
);
},
render() {
return this._render();
}
});
module.exports = App;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhoupan/DotaVideo.git
[email protected]:zhoupan/DotaVideo.git
zhoupan
DotaVideo
DotaVideo
master

搜索帮助