Rather than hard-coding your columns, I would suggest placing them in a data object that you iterate over. I have solved this in the past with something like this:
<th
v-for="(header, i) in visibleHeaders"
:key="i"
scope="col">
{{ header.title }}
</th>
...
data() {
return {
headers: [
{title: 'id', visible: false},
{title: 'First Name', visible: true},
{title: 'Last Name', visible: true},
{title: 'Email', visible: true},
{title: 'Status', visible: true},
{title: 'Notes', visible: true},
]
}
},
computed: {
visibleHeaders() {
return this.headers.map(h => {
return h.visible;
});
}
}
I recognize that this only solves the column headers and that you still need to isolate only the visible fields in your data, but maybe this gives you some ideas on how you might achieve that. Perhaps leads becomes a computed property that maps over another data object and only returns those columns that you've designated as being visible.