₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,456 members, 8,422,155 topics. Date: Sunday, 07 June 2026 at 07:02 PM

Toggle theme

Help With This Vue Js Code - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp With This Vue Js Code (780 Views)

1 Reply (Go Down)

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):
Karleb:
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.
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:
Ha, looks like I won't bother learning again o. What do those alphabet represent in God's name?
grin 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:
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.
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:
Ha, looks like I won't bother learning again o. What do those alphabet represent in God's name?
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:
solve this with this.orders=res.data.products
wink
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:
Wait ooo looking at the code it seems the title is inside the productID object so to access it use
Product.productID.title
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:
seems issue was from mounted hook ,in the orders api he used this.orders=res instead of this.orders=res.data.products
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:
yeah just saw it funny thing that the op has not given us feed back if he has sorted it out
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:
thanks bro it's been sorted already like i said earlier used this.orders=res instead of this.orders=res.data.products
ok keep grinding you will do just fine
1 Reply

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 Code234

The Analysis Of Student Adaptability Levels To Online Education - Using MysqlPlease Enlighten Me On Root AccessHtml - Frame