Home > database >  Vue3 element not displaying
Vue3 element not displaying

Time:11-20

I'm new to vue and i'm starting a project where i want to use a library

Is there something I'm doing wrong here? The code is live in this repo https://github.com/jiwidi/lens_database

CodePudding user response:

Looks like your markup is for the Vue 2 version of Smart Table. Check out the docs for the new Vue 3 compatible version (which is the package you're using). You need to use a <template> tag now to pass in slot props.

<v-table :data="users">
 <template #head>
   <thead slot="head">
     <th>Title</th>
     <th>Artist</th>
   </thead>
 </template>
 <template #body="{ rows }">
   <tbody>
     <tr v-for="row in rows" :key="row.id">
       <td>{{ row.id }}</td>
       <td>{{ row.title }}</td>
     </tr>
   </tbody>
 </template>
</v-table>
  • Related