Below is the fetch method I have defined to retrieve recordings from the database. However, I need assistance in adding a new column to each record specifically for frontend purposes. Can someone help me with this problem?
<script>
export default {
components: {
},
data: function() {
return {
versions: [],
};
},
created: function() {
this.fetchVersions();
},
methods: {
fetchVersions() {
var that = this;
var url = '/area/versions.json';
this.$axios.get(url)
.then(response => {
that.versions = response.data;
})
},
}
};
</script>
The current structure of the versions array is as follows:
versions: [
{
name: 'Version 1',
region: 'CBA 09',
},
{
name: 'Version 2',
region: 'CBA 11',
}
]
I would like to include a new column at the beginning of each record with the same value, similar to this example:
versions: [
{
manager: '0024',
name: 'Version 1',
region: 'CBA 09',
},
{
manager: '0024',
name: 'Version 2',
region: 'CBA 11',
}
]