美文网首页
ionic——expose-aside-when如何在某个页面隐

ionic——expose-aside-when如何在某个页面隐

作者: 一只飞 | 来源:发表于2018-03-09 13:58 被阅读0次

    HTML:

    <ion-side-menus>
      <ion-side-menu side="left" expose-aside-when="(min-width:0px)">
        侧面菜单栏
        {{{true:'',false:'contentDisabled'}[currPage]}}
      </ion-side-menu>
    
      <ion-side-menu-content  ng-class="{true:'contentDisabled',false:''}[currPage]">
        <ion-nav-bar align-title="center">
          <ion-nav-back-button class="button-positive">
          </ion-nav-back-button>
        </ion-nav-bar>
        <ion-nav-view></ion-nav-view>
      </ion-side-menu-content>
    
    </ion-side-menus>
    

    css:

    /*侧面菜单隐藏*/
    ion-side-menu-content.contentDisabled {
      width: auto !important;
      transform: initial !important;
      -ms-transform:initial !important;     /* IE 9 */
      -moz-transform:initial !important;    /* Firefox */
      -webkit-transform:initial !important; /* Safari 和 Chrome */
      -o-transform:initial !important;  /* Opera */
    }
    

    js:

    //监听页面变化
        $scope.currState = $state;
        $scope.$watch('currState.current.name', function(newValue, oldValue) {
          console.log("page:"+newValue);
          if(newValue=='login'||newValue=='master'||newValue == 'addMaster'||newValue==''){
            $rootScope.currPage = true;
          }else{
            $rootScope.currPage = false;
          }
        });
    

    相关文章

      网友评论

          本文标题:ionic——expose-aside-when如何在某个页面隐

          本文链接:https://www.haomeiwen.com/subject/uzvpfftx.html