[Vuejs]-Set buefy <b-dropdown> element to full width

0👍

Example Pen: https://codepen.io/Qumez/pen/RwPWeRV

The b-dropdown component appears to be div.dropdown -> div[role="button"] -> button
So by giving the div and it’s child div, and the grandchild button all a width of 100%, I was able to get the component to expand to the full width.

<div class="dropdown-box">
  <b-dropdown aria-role="list">
    <button class="button is-primary" slot="trigger">
      <span>Click me!</span>
      <b-icon icon="menu-down"></b-icon>
    </button>

     <!-- b-dropdown-items -->
  </b-dropdown>
</div>
.dropdown-box {
    border: 2px solid red;
    div, button {
        width: 100%;
    }
}

0👍

Now, Buefy dropdown already has expanded property. You can make b-dropdown as fullwidth like this:

<b-dropdown expanded>
</b-dropdown>

See more props here

Leave a comment