If you are working with Vuetify version 2.6.0 or higher, there is a slightly different approach to creating multiline buttons.
One important thing to note is that in the default slot, you cannot override the
<span class="v-btn__content">
tag. This can cause your custom content to be wrapped within this tag in the generated HTML.
To address this issue, you can follow these steps:
<v-btn
class="btn-multiline"
width="150"
height="50"
>
<span class="text-wrap">Multiline Button Text</span>
</v-btn>
...
<style>
.btn-multiline > span {
width: 100%
}
</style>
This solution involves defining a custom global class called .btn-multiline
, setting the full width for the
<span class="v-btn__content">
tag, and applying the internal Vuetify class
text-wrap
which adjusts the white-space aspect.
You can test out this workaround on CodePen by visiting this link.