我正在使用angular 4中的flex布局模块,我尝试在桌面模式下并排显示卡片布局,并在移动模式下显示相同的卡布局,但它对我不起作用,请建议适当的代码。
下面是我的代码:
<div fxLayout="row" fxLayout-gt-xs="column">
<mat-card fxflex fxflex-gt-xs="100" fxFlex="33.33%">
<h2>Card title #1</h2>
<mat-card-content>
<p>Some content</p>
</mat-card-content>
</mat-card>
<mat-card fxflex fxflex-gt-xs="100" fxFlex="33.33%">
<h2>Card title #2</h2>
<mat-card-content>
<p>Some content</p>
</mat-card-content>
</mat-card>使用此版本:@angular/flex-layout:^2.0.0-beta.9
发布于 2018-02-24 19:49:18
默认情况下,块元素放置在不同的行中。您只需要处理xs屏幕的方向。
使用这个:-
<div fxLayout.xs="column">
<mat-card fxflex fxflex-gt-xs="100" fxFlex="33.33%">
<h2>Card title #1</h2>
<mat-card-content>
<p>Some content</p>
</mat-card-content>
</mat-card>
<mat-card fxflex fxflex-gt-xs="100" fxFlex="33.33%">
<h2>Card title #2</h2>
<mat-card-content>
<p>Some content</p>
</mat-card-content>
</mat-card>
</div>https://stackoverflow.com/questions/46865288
复制相似问题