[Vuejs]-Vue Render Images inside V-for

0👍

This is my suggestion. Using the v-bind for the src. I am assuming the avatar image is stored in the img folder. I removed the width because it seems that it will not display if the width setting is there.

<tr
      class="bg-gray-100 border-b border-gray-200"
      v-for="currentView in getDashboard()"
      :key="currentView.id"
    >
      <td class="px-4 py-3">
        <img 
          :src="require(`../img/${currentView.avatarUrl}`)"/>
      </td>

Leave a comment