I have a List which is being rendered using v-for and i am outputting the data into one column. Is there a way that after a certain width and height, the data flows into next column without making any new Array? Here is a demo.
new Vue({
el: '#app',
data() {
return {
lists: [{
text: 'Item1'
},
{
text: 'Item2'
},
{
text: 'Item3'
},
{
text: 'Item4'
},
{
text: 'Item5'
},
{
text: 'Item6'
},
{
text: 'Item7'
},
{
text: 'Item8'
},
{
text: 'Item9'
},
]
}
}
})
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet" />
<div id="app">
<v-app id="inspire">
<v-layout class="mt-3 ml-4">
<v-flex md-4>
<div v-for="list in lists" :key="list.text">
{{list.text}}
</div>
</v-flex>
<v-flex md4>
//After a certain width and height, make data flow into this column?
</v-flex>
</v-layout>
</v-app>
</div>
I prefer to use widths and heights instead of creating a new Array just so that i don't have to lot of manual adjustments throughout the code to deal with the new array.
v-flexand convert the first one into a wrapper with a class in an effort to make your markup easier to style.