小程序采坑之setDate

根据双向绑定当我setData的时候input的值应该改变,但是并没有。而且this.data中的值也没有改变

<input
                        class="weui-input"
                        bindinput="bindGZInput"
                        type="number" 
                        value="{{gz}}"
                    >

  

    bindGZInput: function(e) {
      var obj = {};
      this.setData({ gz: parseFloat(e.detail.value) }); 
    },

  

最后只能直接修改  this.gz

猜你喜欢

转载自www.cnblogs.com/Leechg/p/10230214.html
今日推荐