I have a problem in removing the whole column and its corresponding row in vue-table. Here is my code.
<b-table :fields="fields" :items="data">
<template slot="action" slot-scope="data" v-if="authorize = 1">
</template>
</b-table>
export default{
data(){
authorize: 0,
data: [],
fields: [
{key: 'id', label: '#'},
{key: 'name', label: 'Name'},
{key: 'action', label: 'Action'}
],
}
}
In this case, When I use v-if
inside the <template>
it only removes the corresponding row of the column.
This is the result of the code above
| # | Name | Action |
----------------------------------------
| 1 | John Doe | |
| 2 | Chicharon Ni Mang Juan | |
| 3 | Lumanog | |
My Problem is, I want to remove the column itself like this.
| # | Name |
------------------------------
| 1 | John Doe |
| 2 | Chicharon Ni Mang Juan |
| 3 | Lumanog |
#Regards,