My Vue object is filled with various getters and setters. Below is a console.log screenshot for reference:
https://i.sstatic.net/dyPvO.jpg
The structure of the raw data (non-Vue related) appears as follows:
{
Internal_key: "TESTKEY_1",
extensiontable_itc: {
description_itc: "EXTENSION_ITC_1_1",
description_itc2: "EXTENSION_ITC_1_2",
},
extensiontable_sysops: {
description_sysops: "EXTENSION_SYSOPS_1"
}
}
In different scenarios, the data might have varying key-value pairs within the outer object and may also differ in naming conventions for both keys and nested objects.
Is there an effective method to extract this data into a standard JS Object? If not, what would be the best approach to iterate through the Vue object for manual extraction? The AJAX request will be carried out using Axios, if that detail is relevant.
EDIT: Below is the pertinent Vue data:
data() {
return {
editingRecord: {
original: null,
copy: null
}
}
}
Throughout my program flow, data is inputted into both editingRecord.original
and editingRecord.copy
from a form. When the user clicks save/send, the data from editingRecord.original
, including all keys and values, should be sent to the server via an AJAX request.