找回密码
 立即注册
搜索

bug反馈 input输入框不能赋值的问题

1
回复
1445
查看
[复制链接]

4

主题

4

帖子

40

积分

 楼主| 2018-11-20 12:13:49 显示全部楼层 |阅读模式
最近在做一个购物车模块,但是遇到了一个输入框不能动态赋值的问题,求解: for="{{stock}}"> style="flex-direction:column;" if="{{$item && shoppingCar.orderInfo[$idx]}}"> style="flex-direction:row;"> class="tips">{{$item.newLevel}}成新:{{$item.new_stock}}本 class="tips" style=" width:70px;margin-left:5px;color:#FF0000;">¥{{$item.new_price}} class="tips" style=" width: 30px; margin-left:-5px;">/本 style="position:absolute;right:5px;"> class="numBtn" type="button" value="-" style="margin-right: -1px;" onclick="modifyNum( 0,$idx)" /> type="number" id='price' maxlength="3" class="numInput" onchange="setValue($idx) " placeholder="{{shoppingCar.orderInfo[$idx].num}}"> class="numBtn" type="button" value="+" style="margin-left: -1px;" onclick="modifyNum( 1,$idx)" /> class="func" style="background-color:#FF0000;" onclick="addToshoppingCar"> 加入购物车 data:{ shoppingCar: { total_num: 0, total_price: 0, orderInfo: [{}] }, stock: [], } //add to shopping car addToshoppingCar() { var that = this //不起作用,设置后页面显示还是0 that.shoppingCar.orderInfo[0].num=999 prompt.showToast({ message: that.shoppingCar.orderInfo }) bookInfo.addToshoppingCar(that) } 以下是应用截图

显示修改shoppingCar.orderInfo[0].num是成功了的

显示修改shoppingCar.orderInfo[0].num是成功了的
显示修改shoppingCar.orderInfo[0].num是成功了的

但是页面没有更新修改后的内容,即9成新的数字还是0

但是页面没有更新修改后的内容,即9成新的数字还是0
但是页面没有更新修改后的内容,即9成新的数字还是0 输入框不能动态修改值吗?
回复

使用道具 举报

2018-11-21 14:33:38 显示全部楼层
orderInfo: [{}]是个数组,初始化的时候数组是无法间听到的把,改成 orderInfo: { num:0 } 试一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册