Vue
by ujjumaki
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-vue/2.21.2/bootstrap-vue.min.js"></script>
<div id="app">
<div class="overflow-auto">
<b-pagination v-model="currentPage" :total-rows="rows" :per-page="perPage" aria-controls="my-table"></b-pagination>
<b-table id="my-table" :items="nameList" :per-page="perPage" :current-page="currentPage" medium>
</b-table>
</div>
</div>
<!-- I want to hide id column from nameList and display only nameList.first_name and nameList.last_name-->
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
new Vue({
el: "#app",
data: {
nameList: [
{ id: 1, first_name: 'Great', last_name: 'Gazzoo' },
{ id: 2, first_name: 'Rockhead', last_name: 'Slate' },
{ id: 3, first_name: 'Pearl', last_name: 'Slaghoople' },
{ id: 4, first_name: 'Jasmine', last_name: 'Rit' }
],
perPage: 2,
currentPage: 1
},
computed: {
rows() {
return this.nameList.length
}
},
})