<view class="time">
<uni-forms-item label="讲座开始时间" name="post_time" required>
<uni-datetime-picker type="datetime" v-model="lecData.post_time" @change="changeLog" />
</uni-forms-item>
<uni-forms-item label="讲座地点" name="post_position" required>
<uni-easyinput v-model="lecData.post_position" placeholder="请输入地点" />
</uni-forms-item>
<uni-forms-item label="讲座限制人数" name="num_limit" required>
<uni-easyinput v-model.number="lecData.num_limit" placeholder="请输入讲座限制人数" type="number" />
</uni-forms-item>
</view>
data() {
return {
"imageStyles":{
"height": 150, // 边框高度
"width": 265 // 边框宽度
},
lecData: {
post_time: '',
post_position: '',
num_limit: 0,
}
}
}
使用v-model.number 双向绑定数据 默认值设为0 若不更改 提交时则为number0 若在表单中修改 提交时会变成字符串 求解