After searching high and low, I still can't seem to find the answer to my simple question. Maybe it doesn't exist, but I won't give up just yet.
So here's the scenario:
I created a global prototype in Vue, essentially a global class, with a function inside. When I pass my object to it and try to retrieve the object's name, I come up empty.
Here's the code snippet:
// index.vue
export default {
data() {
return {
portfolio: {
portfolioID: null
}
}
},
async mounted() {
// set model to new data // send old model
this.portfolio = await this.$content.get(this.portfolio)
}
}
// other file
export default class Content {
static async get(content_type) {
if (typeof content_type == 'object') {
// [need to get the output of `portfolio`] out of the
// content_type object
}
else { return { message: 'Input needs to be a model' } }
}
}
I'm not interested in the keys of the portfolio object. I need the actual output of 'portfolio' in the get function of the content class.
This is currently my response in the get function from the content_type object:
{
portfolioID
}
but what I'm hoping for is:
portfolio: {
portfolioID
}
or at the very least, to retrieve the name 'portfolio'