如何更新值在quasar的数组中存在
我将数组声明为
const myproducts = ref([])
之后,我将值推向数组。现在,myproducts
就像
[ { "id": 1, "qty": 1 }, { "id": 7, "qty": 1 } ]
var old_qty = myproducts.value.find(x => x.id === id).qty
var new_qty = old_qty +1
我如何使用new_qty的ID 1中的数组中存在QTY?
tia
i declared array as
const myproducts = ref([] )
After that i pushed value to array. Now myproducts
is like
[ { "id": 1, "qty": 1 }, { "id": 7, "qty": 1 } ]
var old_qty = myproducts.value.find(x => x.id === id).qty
var new_qty = old_qty +1
How can i increment qty exist in array with id 1 with new_qty ?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者
or