Align elements to sides in vuetify3 block button: guide
P粉680000555
P粉680000555 2023-08-30 09:59:30
0
1
453
<p>Suppose I have the following button: </p> <pre class="brush:php;toolbar:false;"><v-btn block size="x-large"> <v-btn icon size="small" variant="contained"> <v-icon>mdi-information</v-icon> </v-btn> Button Text <v-icon>mdi-check</v-icon> </v-btn></pre> <p>The icons on the left and right are sandwiched with the text. How can I place them on the right and left edges of the button respectively? I've tried using <code>v-spacer</code>s but it doesn't work. I also tried using <code>v-row</code> in the button, but that didn't help as the items became even more misaligned. </p>
P粉680000555
P粉680000555

reply all(1)
P粉573809727

You can align items horizontally using the justify property.

Live Demo:

new Vue({
  el: '#app',
  vuetify: new Vuetify()  
})
<script src="https://unpkg.com/vue@2.x/dist/vue.js"></script>
<script src="https://unpkg.com/vuetify@2.6.10/dist/vuetify.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/vuetify@2.6.10/dist/vuetify.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"/>
<link rel="stylesheet" href="https://unpkg.com/@mdi/font@6.x/css/materialdesignicons.min.css"/>
<div id="app">
  <v-app id="inspire">
    <v-btn block size="x-large">
      <v-row justify="space-between">
        <v-col md="4">
          <v-btn icon size="small" variant="contained">
            <v-icon>mdi-information</v-icon>
          </v-btn>
        </v-col>
        <v-col>Button Text</v-col>
        <v-col md="4">
          <v-btn icon size="small" variant="contained">
            <v-icon>mdi-check</v-icon>
          </v-btn>
        </v-col>
      </v-row>
    </v-btn>
  </v-app>
</div>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!