I
I
it_pear_yurec2021-02-14 22:33:39
Vue.js
it_pear_yurec, 2021-02-14 22:33:39

How to display the desired array values?

I output the cartProducts value, which outputs an array of data:

[{ "key": "KxXlVxlundefinedundefined410", "product": { "slug": "bake7", "price": 410, "title": "запеченный ролл с
  муссом
  из лосося. 320 ГР.", "images":
  ["/files/kokVyxP/38146d4ab7b66d5faa384fa0b4f3e728/запеченный_ролл_с_муссом_из_лосося._320_ГР._410_Р.jpg"],
  "category": "NxK8Yov", "id": "KxXlVxl", "created_at": "2021-02-07T11:06:05.936783Z", "updated_at":
  "2021-02-07T11:06:05.936804Z" }, "price": 410, "qty": 1 }, { "key": "Dwa4zopundefinedundefined450", "product": {
  "slug":
  "bake8", "price": 450, "title": "ЗАПЕЧЁННЫЙ РОЛЛ С ТУНЦОМ 310 ГР.", "images":
  ["/files/kokVyxP/b5c8c7b9a47b1b13f26f80a0e06c4d97/ЗАПЕЧЁННЫЙ_РОЛЛ_С_ТУНЦОМ_РИС_ЛОСОЬ_ЖАРЕНЫЙ_МАЙО_8tvDlcu.jpg"],
  "category": "NxK8Yov", "id": "Dwa4zop", "created_at": "2021-02-07T11:07:00.317228Z", "updated_at":
  "2021-02-07T11:07:00.317250Z" }, "price": 450, "qty": 1 }]


Question: How can I display the current title and qty values ​​from the array, please help?????

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-02-14
@it_pear_yurec

<p v-for="product in cartProducts" :key="product['key']">
  {{ product.product.title }} - {{ product.product.qty }}
</p>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question