No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Insert a image in on column in my table

    Help
    2
    2
    391
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      acros last edited by acros

      How can I insert an image on one row of my table? I have tried to put v-if in my loop through the columns but I cannot get it right. I am pretty new to quasar so I might confuse things. My idea was to use the v-if for checking if the column name is ‘Image’ insert an image. And only in that column

      My columns are Name, Age and Image

      Here is my code:

          <template v-slot:body="props">
            <div class="row-spacing"></div>
            <q-tr
              :props="props"
              :class="tableFormat(props.row)"
              @click="onRowClick($event, props.row)"
            >
              <q-td
                class="td-my"
                v-for="col in props.cols"
                :key="col.name"
                :props="props"
                >{{ col.value }}
                <div v-if="col.name === 'Image'">
                  <img class="profile-img" :src="profileimg[0].url" />
                </div>
              </q-td>
            </q-tr>
          </template>
      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @acros last edited by dobbel

        @acros

        Here’s a codepen
        https://codepen.io/ontwikkelfabriek/pen/ExgagbB

        I used this demo:
        https://quasar.dev/vue-components/table#Body-slots

        1 Reply Last reply Reply Quote 1
        • First post
          Last post