1

Any one know how to use text-truncate with v-button. My current attempts are this:

enter image description here

<v-menu
  offset-y>
  <template v-slot:activator="{on, attrs}">
    <v-btn
      text
      v-bind="attrs"
      v-on="on"
      :max-width="150"
      class="text-truncate"
      ><span class="text-truncate;max-width:150px">{{ userEmail }}</span></v-btn>
  </template>
  <v-list>
    <v-list-item-group>
    <v-list-item
      v-for="(item, index) in personalMenuItems"
      :key="index"
      @click="item.action">
      <v-list-item-title>{{ item.title }}</v-list-item-title>
    </v-list-item>
  </v-list-item-group>
 </v-list>
</v-menu>
Jamie Marshall
  • 1,885
  • 3
  • 27
  • 50

1 Answers1

2

Make sure your properly setting the max-width style...

<v-btn text v-bind="attrs"
    v-on="on"
   :max-width="150">
   <span class="text-truncate" style="max-width:150px">{{ userEmail }}</span>
</v-btn>

Demo

Carol Skelly
  • 351,302
  • 90
  • 710
  • 624