<form bindsubmit="formSubmit" bindreset="formReset">
<slider name="slider" show-value min="-1" max="10" value="1" ></slider>
<view class="btn-area">
<button formType="submit">Submit</button>
<button formType="reset">Reset</button>
</view>
</form>
formSubmit: function (e) {
console.log('form发生了submit事件,携带数据为:', e.detail.value)
},
formReset: function () {
console.log('form发生了reset事件')
},
slider 拖动到1时,正常,form发生了submit事件,携带数据为: {slider: 1}
slider 拖动到0时,就出现slider为空!!!!
index.js? [sm]:8 form发生了submit事件,携带数据为: {slider: ""}
https://developers.weixin.qq.com/s/7ATrJhmu7ngk
这是对应的小程序片段