列表渲染后数值前面怎么有个点?
发布于 6 年前 作者 songyong 4475 次浏览 来自 问答
  • 当前 Bug 的表现(可附

截图)

<!–index.wxml–>

<view wx:if="{{devicenamearr.length>0}}“class=‘item’ wx:for=”{{devicenamearr}}">

<view  class=‘yangshi’>

<view class=“yangshi1”>器材名称</view>

<view class=‘yangshi2’>{{item.devicename}}

</view>

</view>

<view class=‘yangshi’>

<view class=‘yangshi1’>数量</view>

.

<view class=‘yangshi2’>{{item.shuliang}}

</view>

</view>

</view>

<view class=“section”>

<view class=“section__title”>器材名称</view>

<picker bindchange=“bindPickerChange” value="{{index}}" range="{{array}}">

<view class=“picker”>

当前 :{{devicename}}

</view>

</picker>

</view>

<view class=‘yangshi’>

<view class=‘yangshi1’>数量</view>

<input class=‘yangshi2’ name=“shuliang” placeholder=“数量” type=“number” bindinput=“inputnum” id=’{{i}}'auto-focus />

</view>

<button class=‘button7’ bindtap=‘tianjia’>+</button>

Page({

data: {

devicename: ‘1’,

shuliang: 1,

devicenamearr: [],

array:[1,2,3,4]

},

tianjia(e) {

var devicename = this.data.devicename

var shuliang = this.data.shuliang

var devicenamearr = this.data.devicenamearr

if (shuliang.length > 0) {

var o = {}

o = {

devicename: devicename,

shuliang: shuliang

}

devicenamearr.push(o)

}

console.log(’-------------’ + devicenamearr[0])

this.setData({

devicenamearr: devicenamearr,

})

},

// 点击下拉显示框

bindPickerChange: function (e) {

var devicename = this.data.array[e.detail.value];

console.log(e)

this.setData({

devicename: devicename

});

console.log(‘devicename’ + devicename)

},

inputnum: function (e) {

let shuliang = e.detail.value

this.setData({

shuliang: shuliang

})

}

})

  • 预期表现
  • 复现路径
  • 提供一个最简复现 Demo
2 回复

。。。。。。。。。。。。

你自己写的点啊

回到顶部