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="teamList" :per-page="perPage" :current-page="currentPage" medium>
</b-table>
</div>
</div>
<!-- I want to change First Name value into linkable event as @onClick or v-on:click -->
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: {
teamList: [
{ id: 1, first_name: 'Pebbles', last_name: 'Flintstone' },
{ id: 2, first_name: 'Bamm', last_name: 'Rubble' },
{ id: 3, first_name: 'Great', last_name: 'Gazzoo' },
{ id: 4, first_name: 'Rockhead', last_name: 'Slate' },
{ id: 5, first_name: 'Pearl', last_name: 'Slaghoople' }
],
perPage: 2,
currentPage: 1
},
computed: {
rows() {
return this.teamList.length
}
},
})