标签:app ide dom profile file 怎么 asc out const
import {Provider} from ‘react-redux‘ import {Router, hashHistory, Route, IndexRoute, Switch} from ‘react-router‘; import store from ‘redux/store.js‘; // redux store import KYRYComponent from ‘./components/KYRYComponent‘; const routes = ( {/* redux 所有组件共用 */} <Provider store={store}> <Router history={hashHistory}> <Route path="/" component={App}> {/*3个角色 */} <IndexRoute component={KYRYComponent} /> <Route path="cloudProfile" component={CloudOverviewView}/> <Route path="*" component={Error}/></Route> </Router> </Provider> ); ReactDOM.render(routes, document.getElementById(‘root‘));
import React from ‘react‘; // import Experimentlist from ‘../StudentComponent/Experimentlist‘; // import Classmangement from ‘../TeacherComponent/Classmangement‘; // import CloudOverviewView from ‘../page/CloudOverviewView‘; // import Myclass from ‘../StudentComponent/Personalcenter/Myclass‘; import DataCenterOverviewView from ‘../page/DataCenterOverviewView‘; class KYRYComponent extends React.PureComponent { constructor(props){ super(props); } render(){ //如果student 走这个组件 user_type怎么来的 // if(user_type==‘Student‘) { // return <Myclass /> //如果Teacher 走这个组件 // }else if(user_type==‘Teacher‘){ // return <Classmangement /> //如果Admin 走这个组件 首页走这个 // }else{ return <DataCenterOverviewView /> // } } } export default KYRYComponent;
标签:app ide dom profile file 怎么 asc out const
原文地址:https://www.cnblogs.com/zhanglanzuopin/p/12922627.html