0

The idea is to have in each row (row) two columns, how could I manage this in the vue loop?

Something I hope:

enter image description here

Html:

<div class="row">
  <div v-for='(item,indice) in produtos' :key='indice'>
    <q-card inline class="q-ma-sm col-6">
      <q-card-media>
        <img v-bind:src="item.url">
      </q-card-media>
      <q-card-actions align="around">
        <q-btn flat round icon="fas fa-shopping-cart" @click="cart($event,item)"/>
        <q-btn flat round icon="favorite" @click="favorite($event,item)"/>
        <q-btn flat round icon="share" to="whatsapp://send?text=Hello%20World!" />
      </q-card-actions>
    </q-card>
  </div>
</div>
3
  • What is not working with the code you posted? Each card should fill a space of 6 columns, with two cards filling the whole row (12 columns) and then wrap to a new line. Commented Jul 30, 2018 at 12:33
  • @puelo I can not seem to create two columns in each row. Commented Jul 30, 2018 at 12:34
  • maybe put the v-for on the q-card and remove the wrapping div. Commented Jul 30, 2018 at 12:36

1 Answer 1

2

Can you try this:

<div class="row">
  <div v-for='(item,indice) in produtos' :key='indice' class="col-6">
    <h1>{{ item }}</h1>
  </div>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.