Kos-Mos
Kos-Mos

Reputation: 707

Why vuetify <v-list> doesn't produce <li> tags

Wasn't this component supposed to render lists? It produces only divs instead of more semantic elements, couldn't it be considered a bad practice? Should I use native html tags instead of this component if i desire semantic html?

Upvotes: 1

Views: 1695

Answers (1)

Igal
Igal

Reputation: 6103

This component does render a list. Though they do use divs by default, their API provides a way to change this behavior - you can specify tags on your v-list:

<v-list tag='ul'>
  <template v-for="(item, index) in items">
    <v-list-item tag='li' :key='index'>
      {{ item }}
    </v-list-item>
  </template>
</v-list>

This will render a ul/li list.

Upvotes: 6

Related Questions