Within my project, I have a masterData.js file that serves as a repository for my master data. This file retrieves data from my mongo db and distributes it to various components of the project. To facilitate this process, I have implemented a function within the masterData.js file to export a string:
/ ***************************** MUTATIONS
const mutations = {
exportColumns (payload) {
Object.keys(payload[0]).map(x => { return x; });
}
}
The 'payload' variable holds all the rows of data, with 'payload[0]' containing the column header names. The output of executing this code snippet is as follows:
["_id","businessAreaName","businessAreaDisplay","councilDisplay","councilID"]
My goal is to transfer these values to my masterData.vue file. Currently, the code in my masterData.Vue file looks like this:
importColumns ()
{
let payload = {
vm: this,
mutation: 'masterData/exportColumns'
};
}
What additional steps should I take to verify whether the column names have been successfully received?