New user
New user

Reputation: 147

How to add icon in subgroup

I am newbie in Vuetify, and I want to change the "MP in front of the My Profile become an icon. " Anyone know how to change it become an icon?? Please Help me, Thank you!! Here the picture

Item.vue

<v-list-item-icon
  v-if="text"
  class="v-list-item__icon--text"
  v-text="computedText"
/>

<v-list-item-icon v-else-if="item.icon">
  <v-icon v-text="item.icon" />
</v-list-item-icon>


<v-list-item-content v-if="item.title || item.subtitle">
  <v-list-item-title v-text="item.title" />


  <v-list-item-subtitle v-text="item.subtitle" />

</v-list-item-content>

ItemGroup.vue

<template v-slot:activator>
  <v-list-item-icon
    v-if="text"
    class="v-list-item__icon--text"
    v-text="computedText"
  />
  <v-list-item-avatar
    v-else-if="item.avatar"
    class="align-self-center"
    color="grey"
  >
    <v-img src="https://demos.creative-tim.com/material-dashboard-pro/assets/img/faces/avatar.jpg" />
  </v-list-item-avatar>

  <v-list-item-content>
    <v-list-item-title v-text="item.title" />
  </v-list-item-content>
</template>

<template v-for="(child, i) in children">
  <base-item-sub-group
    v-if="child.children"
    :key="`sub-group-${i}`"
    :item="child"
  />

  <base-item
    v-else
    :key="`item-${i}`"
    :item="child"
    text
  />
</template>

ItemSubGroup.vue

<base-item-group

:item="item"
text
sub-group

/>

Upvotes: 1

Views: 649

Answers (1)

TDAK
TDAK

Reputation: 134

May be this

<v-list-item-icon
  v-if="text"
  class="v-list-item__icon--text"
  v-text="computedText"
/>

is always true, so that the icon is not rendered.

Upvotes: 1

Related Questions