首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法隐藏角度材料的弹性布局行

无法隐藏角度材料的弹性布局行
EN

Stack Overflow用户
提问于 2020-11-08 21:56:03
回答 1查看 210关注 0票数 0

我无法在angular material 7中隐藏angular flex布局中的div行。请找到我的以下代码。

代码语言:javascript
复制
<div fxLayout="column" class="dashboard-fx">
  <div fxLayout="row" fxLayoutAlign="start start" fxLayoutGap="5px" 
  class="dashboard-pie">
  some code here 
  </div>
    <div fxLayout="row" fxLayoutAlign="start start" fxLayoutGap="5px" 
  [ngStyle]="{display: (subsectionData.length == 0) ? 'none' : 'block'}">
  some code here
  </div>
    <div fxLayout="row" class="list-section" fxLayoutAlign="start start" 
  fxLayoutGap="5px" [ngStyle]="{display: (vsectionData.length == 0)? 'none':'block'}">
  some code here
  </div>
</div>

在我的例子中,*ngIf是不可取的,因为如果我使用ngIf,元素将从

EN

回答 1

Stack Overflow用户

发布于 2020-11-08 23:32:58

fxShow还是fxHide

代码语言:javascript
复制
<div fxLayout="column" class="dashboard-fx">
  <div
    fxLayout="row"
    fxLayoutAlign="start start"
    fxLayoutGap="5px"
    class="dashboard-pie"
  >
    some code here
  </div>
  <div
    fxLayout="row"
    fxLayoutAlign="start start"
    fxLayoutGap="5px"
    [fxShow]="subsectionData.length"
  >
    some code here
  </div>
  <div
    fxLayout="row"
    class="list-section"
    fxLayoutAlign="start start"
    fxLayoutGap="5px"
    [fxShow]="vsectionData.length"
  >
    some code here
  </div>
</div>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64738888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档