Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Items not aligning properly in vue

I am using vue with vuetify library to create a page. On the page I have cards which can be of any numbers which I want to display. I am using a loop to display all cards. But the alignment is having an issue. All the cards are coming in one whole row. It is ok if the cards are just a few. The alignment looks fine then. But if the cards are more like around 10 the page looks off.

Image of the layout

<template>
<div class="d-flex justify-center mb-6 mt-10">

    <v-card
      class="mr-4 ml-4"
      v-for="(cat, index) in cards"
      :key="index"
      outlined
    >
      <v-card-actions>
        <v-btn @click="getdata(cat._id)" plain>
          {{ cat.category }}
        </v-btn>
      </v-card-actions>
    
  </v-card>
</div>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should add the class flex-wrap so that items continue in a new line rather than overflowing.

// (...)
<div class="d-flex justify-center flex-wrap mb-6 mt-10">
// (...)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading