I am looking to format the code below so that the .filter-container
s are displayed next to each other in rows. If a .filter-container
has a .header-container
, it should start on a new line and the remaining .filter-container
s will continue to sit next to it on the new line, and so forth.
new Vue({
el: "#app",
data: {
options: [
{
Id: 80,
group: { GroupName: "MatrixDesc" },
column: { ColumnAlias: "ReviewStatus" },
},
{ Id: 81, group: { GroupName: "" }, column: { ColumnAlias: "AOI" } },
{
Id: 82,
group: { GroupName: "" },
column: {
ColumnAlias: "Location",
},
},
{
Id: 83,
group: { GroupName: "Header2" },
column: { ColumnAlias: "Chemical" },
},
{
Id: 84,
group: { GroupName: "" },
column: {
ColumnAlias: "CollectionDate",
},
},
],
},
})
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="03616c6c77707771627343372d302d32">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<div class="d-flex flex-wrap align-items-end mx-3">
<div v-for="(fdata, index) in options" :key="index">
<span v-if="fdata.group != null">
<div v-if="fdata.group.GroupName" class="header-container">
<h4>{{ fdata.group.GroupName }}</h4>
</div>
<div class="Filter-with-header">
<div class="Filter-info-wrapper">
<input
type="text"
spellcheck="false"
v-model="fdata.column.ColumnAlias"
/>
</div>
</div>
</span>
</div>
</div>
</div>
https://i.sstatic.net/NL4lT.png
Current layout: