input的value值数据怎么转换为数字?
发布于 6 年前 作者 guiyingwu 7042 次浏览 来自 问答

实现如上图的功能,单击减号数字减,单击加号数字加1,

现在问题是:如果我直接手动输入43,然后在点加号结果出现是431,怎么对数据进行转换。

addBuyCount:function(){
      var that = this;
      var tmp = that.data.buyCount+1;
      that.setData({
        buyCount:tmp
      });
  },
1 回复
回到顶部