1
我有ng-repeat
創建的組件,我想他們是柔性的孩子:Flexbox的與AngularJS 1.5組件
<div style="display:flex; flex-wrap: wrap">
<div ng-repeat="item in data" style="flex-basis: 30%">
<my-component item="item"></my-component>
</div>
<div>
在哪裏我的組件的模板:
<div class="c">
...
</div>
這是一種工作,但my-component
的物品並不都像它們一樣高,如果它們只是div
s。
我可以通過設置.c{height: 100%}
解決此,但它與包裝弄亂。
我可以acheive與AngularJS 1.5在所有的這種行爲?
連接codepen爲攝製:http://codepen.io/anon/pen/ENqvvO
謝謝!
謝謝!事實上,添加一個包裝器組件(像這樣:http://codepen.io/anon/pen/pNMdZE),但爲什麼不能用當前的DOM元素來實現呢? – bomba6
@ bomba6因爲該組件的標籤不被它的模板所取代,它會返回他的內容他的標籤內,因爲該元素是不撓,它打破了與包裝,這是柔性以及該項目的關係。 Basicaly你有'flex-block-flex',這個塊會阻止任何事情。 –
@ bomba6你有想過嗎?它對你有用嗎? –