Vue-material: How to make md-input and md-button display inline?

Created on 2 Feb 2018  路  10Comments  路  Source: vuematerial/vue-material

Browser: Chrome
Vue 2 with vue-material-beta

For example:

  <md-content>
    <md-field class="md-alignment-top-left">
     <md-input></md-input>
    </md-field>
    <md-button class="md-alignment-top-right">test</md-button>
  </md-content>
question

Most helpful comment

All 10 comments

Hey, can you please explain what you mean inline? or create some example?

@Samuell1 I wish the components display in the same row.
like <span></span> <span></span> not <div></div> <div></div>

I think this kind of layout make the user easily understand inputand buttonare paired.
The button's size is based on the text of the button, and the input will fill remaining space.

Like this

You can use Layout (https://vuematerial.io/ui-elements/layout)

<div class="md-layout">
   <div class="md-layout-item">
      input here
   </div>
   <div class="md-layout-item">
      button here
   </div>
</div>

@Samuell1 I tried that but the width of md-layout-item are equal, looks really weird. it better displays flex. I wonder why the md-alignment-top-right doesn't work.

@VdustR Thanks!

@arkceajin md-alignment-top-right works only ifdisplay: flex or md-layout class is on element

@Samuell1
https://codepen.io/arkceajin/pen/ZrQGVy
Could you please help check this code, still not work.

it needs to be on same element @arkceajin

That is for parent

  <div class="md-layout box md-alignment-top-right">
    <md-button>TOP RIGHT</md-button>
    <span>SPAN TOP RIGHT</span>
  </div>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

delueg picture delueg  路  3Comments

maryleloisa picture maryleloisa  路  3Comments

sandhose picture sandhose  路  3Comments

andreujuanc picture andreujuanc  路  3Comments

tridcatij picture tridcatij  路  3Comments