Can anyone help me align the dropdown button child items horizontally? I've tried customizing it with CSS but no luck. The control link can be found here
Check out a sample on Js Fiddle here
This is how I expect the design to look like:
https://i.sstatic.net/TAo7p.png
new Vue({
el: '#app',
data:{
fruits: ['Apple', 'Banana', 'Orange'],
selectedFruit: '',
},
methods: {
selectFruit (index) {
this.selectedFruit = this.fruits[index]
}
}
})
.dropdown-demo {
width: 200px;
background-color: white;
border-bottom: solid 1px black;
>div {
background-color: azure;
width: 100%;
button {
background-color: yellow !important;
padding-left: 0;
padding-right: 0;
width: 100%;
text-align: right
}
}
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap/dist/css/bootstrap.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.js"></script>
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.css"/>
<script src="//unpkg.com/babel-polyfill@latest/dist/polyfill.min.js"></script>
<script src="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.js"></script>
<div id="app">
<div class="dropdown-demo">
<b-dropdown variant="link" size="lg" no-caret>
<template slot="button-content">
<span>Fruits:</span>
<span> {{selectedFruit}}</span>
🔍<span class="sr-only">Search</span>
</template>
<b-dd-item v-for="(item, id) in fruits"
@click="selectFruit(id)"
:key="id">
{{item}}
</b-dd-item>
</b-dropdown>
</div>
</div>