Help With This Vue Js Code - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help With This Vue Js Code (780 Views)
| Help With This Vue Js Code by arejibadz(op): 6:18am On Jul 16, 2022 |
this is my json object [ { "_id": "62d163b638cbafee24c6d663", "products": [ { "productID": { "_id": "625672a8370e769a8a93a51e", "reviews": [], "owner": { "_id": "6220db7ee861f3dbbaf21e3d", "name": "mr jacob", "about": "hello", "__v": 0 }, "category": "62566ec30e42d6c5ab370e7c", "title": "galaxy note", }, } ], } ] how can i display the {{product.title}} is my vue template |
| Re: Help With This Vue Js Code by arejibadz(op): 6:20am On Jul 16, 2022 |
my template and script tag
|
| Re: Help With This Vue Js Code by Abudu2000(m): 6:33am On Jul 16, 2022 |
Ha, looks like I won't bother learning again o. What do those alphabet represent in God's name? |
| Re: Help With This Vue Js Code by Karleb(m): 7:12am On Jul 16, 2022 |
What error are you having? I think your problem is coming from the token. You have to JSON.parse it before using it. You also have to stringify it while storing it. |
| Re: Help With This Vue Js Code by arejibadz(op): 7:48am On Jul 16, 2022*. Modified: 9:59am On Jul 16, 2022 |
Karleb:this my error , i don't think it's the token ,i get the order for a specific user
|
| Re: Help With This Vue Js Code by Adeling(m): 9:06am On Jul 16, 2022 |
Abudu2000: Don't get discouraged. The OP did not start programming yesterday. Start from the basics and learn the foundamentals.To your question...since your error is telling you undefined title property, why not look at the title you are having issue with and trace wath maybe wrong |
| Re: Help With This Vue Js Code by arejibadz(op): 10:21am On Jul 16, 2022 |
Karleb:solve this with this.orders=res.data.products |
| Re: Help With This Vue Js Code by arejibadz(op): 10:22am On Jul 16, 2022 |
Abudu2000:lol, just learn the basics and start building stuff with js framework,you'll understand the concepts in no time, stackoverflow ,youtube and Google should be your best friends |
| Re: Help With This Vue Js Code by Karleb(m): 10:51am On Jul 16, 2022 |
arejibadz: ![]() |
| Re: Help With This Vue Js Code by peterincredible: 11:43am On Jul 16, 2022 |
Wait ooo looking at the code it seems the title is inside the productID object so to access it use Product.productID.title |
| Re: Help With This Vue Js Code by Tunechi5(m): 12:46pm On Jul 16, 2022 |
peterincredible:seems issue was from mounted hook ,in the orders api he used this.orders=res instead of this.orders=res.data.products |
| Re: Help With This Vue Js Code by peterincredible: 9:13pm On Jul 16, 2022 |
Tunechi5:yeah just saw it funny thing that the op has not given us feed back if he has sorted it out |
| Re: Help With This Vue Js Code by arejibadz(op): 9:46pm On Jul 16, 2022 |
peterincredible:thanks bro it's been sorted already like i said earlier used this.orders=res instead of this.orders=res.data.products |
| Re: Help With This Vue Js Code by peterincredible: 10:07pm On Jul 16, 2022 |
arejibadz:ok keep grinding you will do just fine |
Wrote My First JS Code On VS Code.... Lol (pics) • What Would Be The Output Of This JS Code (pics) • Please I Need Explanation Of This Express.js Code • 2 • 3 • 4
The Analysis Of Student Adaptability Levels To Online Education - Using Mysql • Please Enlighten Me On Root Access • Html - Frame
Don't get discouraged. The OP did not start programming yesterday. Start from the basics and learn the foundamentals.