0๐
โ
I managed to sort it out.
You controller section should include.
async showAll (req, res) {
try {
const products = await Product.findAll({
where: {},
include: [
{
model: ParentName
}
]
})
res.send(products)
} catch (err) {
res.status(500).send({
error: 'An Error has occured trying to retrieve Products'
})
}
}
Your .vue component Script section
async mounted () {this.products = (await ProductsService.showAll()).data
}
And calling it in the Template Component within vue becomes easy
{{ props.item.Principal.name }}
Source:stackexchange.com