devlop是否激活 两个页面部根据state的字段来判断

This commit is contained in:
caishi 2022-05-30 14:01:55 +08:00
parent 90bb5297f3
commit ba283d7c13
3 changed files with 17 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import Loadable from 'react-loadable';
import Loading from '../../Loading';
const About = Loadable({
loader: () => import('./About'),
loader: () => import('./subIndex'),
loading: Loading,
})
const New = Loadable({
@ -66,7 +66,8 @@ export default ((props)=>{
{/* 原本的两种合为一个 */}
<Route path="/:owner/:projectsId/devops"
render={
(p) =>{return( p.location && p.location.state && p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
// (p) =>{return( p.location && p.location.state && p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
(p) =>{return(<About {...props} {...p}/>)}
}
></Route>
</Switch>

View File

@ -0,0 +1,13 @@
import React from 'react';
import About from './About';
import Dispose from './Dispose';
function SubIndex(props) {
return(
props && props.open_devops ?
<Dispose {...props} />
:
<About {...props} />
)
}
export default SubIndex;

View File

@ -32,7 +32,7 @@ function DetailBanner({ history,list , owner , projectsId ,showNotification , ur
}
}).catch(error=>{})
}
console.log("detail:",open_devops);
return(
<div className="f-wrap-between mt25">
<QuitBox visible={visible} onCancel={()=>setVisible(false)} name={projectDetail && projectDetail.name} onSuccess={onSuccess}/>