Popper隐藏页面组件

时间:2019-01-30 11:32:35

标签: reactjs material-ui

我有一个页面,其中侧边栏为主要组件,页面的其余部分为子组件,我在应用栏中有一个弹出按钮,用于按钮,我想移动侧边抽屉的子组件进行移动出现在popper的左侧

我已经拥有所有组件,只需要将组件移至弹出器的左侧

foreach(var item in list)
{
    var child1 = item as Child1;
    if(item != null)
    {
        child1.DoSomething();
    }
    var chil2 = item as Child2;
    ...
}

1 个答案:

答案 0 :(得分:0)

用于将内容移动到一侧的写风格,就像我对侧抽屉所做的那样

 contentShift: { 
    marginRight: popperwidth, width: `calc(100% - ${popperwidth}px)`, transition: 
    theme.transitions.create(['width', 'margin'], { easing: 
    theme.transitions.easing.sharp, duration: theme.transitions.duration.enteringScreen, 
    }),
 },
 state = {
     open: false,
     popup:false,
     anchorEl: null,
     notifier:false,
  }; 
 handleToggle = 
    event => { 
     const { currentTarget } = event; this.setState(state => ({ anchorEl: 
    currentTarget, popup: !state.popup, }));
    }
------------------------------------------------------------------------