I am currently working on a small billing application and I am facing difficulties with the cost lookup feature. I have gone through the Vue.js documentation but it didn't provide much help.
This is a snippet of my code:
<tr><td><input type="text" v-model="prod0"></td><td><input type="number" v-model="qty0"></td><td>{{total0=cost0*qty0}}</td></tr>
My main goal is to extract the cost of a product based on the id entered by the user in prod0, by looking up this information from a JSON object.
The structure of my JSON data is as follows: { "Mango":"100", "Tomato":80, "Carrot":"120" };
I would greatly appreciate it if someone could guide me with a JSFiddle example or reference on how to effectively perform a JSON lookup, cross-reference the data, and retrieve the exact cost associated with a given product name.