I have some code that extracts specific keys and values from a row and then sends them to the next page.
let HistoryData = [];
for (const [key, value] of Object.entries(this.Items)) {
HistoryData.push(value)
}
this.$router.push({ name: "History" });
I am looking to send only certain keys and their corresponding values instead of the entire row.
"Code": "red",
"AccNumber": "12345",
"InvNum": "1234"
These specified keys can vary if multiple rows are selected, resulting in an array of objects with different key-value pairs.
To achieve this, I believe I need to implement filters on the JSON data as shown below:
[
{
"InvNum": "X34343",
"billDate": "2022-05-31T00:00:00Z",
"billingAddress": "Address 6",
"Code": "CCN",
"AccNumber: "2343456"
},
{
"InvNum": "5464564",
"billDate": "2022-05-31T00:00:00Z",
"billingAddress": "Address 5",
"Code": "g",
"AccNumber: "556"
},
...
]
I need to pass an array of objects to the next page containing only the InvNum, Code, and AccNumber keys - excluding billDate and billingAddress.