调整底部栏render数据

This commit is contained in:
许红梅 2022-09-07 18:55:26 +08:00
parent 6e61ab1239
commit 03289ae434
1 changed files with 33 additions and 1 deletions

View File

@ -5,11 +5,43 @@ export default class bottomBar extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state={
navList:[], navList:[
{
id:1,
iswitch:true,
name:'index',
pic:{
show:'',
selectShow:''
},
text:'首页'
},
{
id:2,
iswitch:true,
name:'order',
pic:{
show:'',
selectShow:''
},
text:'订单'
},
{
id:3,
iswitch:true,
name:'coupon',
pic:{
show:'',
selectShow:''
},
text:'我的券'
}
],
active:0 active:0
} }
} }
componentWillReceiveProps(nextProps){ componentWillReceiveProps(nextProps){
console.log(1313);
let navList=nextProps.bottomBarConfig.navlist; let navList=nextProps.bottomBarConfig.navlist;
let naVisual=navList.filter(item=>item.iswitch); let naVisual=navList.filter(item=>item.iswitch);
this.setState({navList:naVisual}); this.setState({navList:naVisual});