picker组件“pages/chezhu/main”没有要处理的方法“bindTimeChange”??
用的Vue写的
<view class="left1">出发时间:
<view class="liubai">
<picker mode="time" value="value" start="09:01" end="21:01" bindchange="bindTimeChange">
<view class="picker">
<div>{{time}}</div>
</view>
</picker>
</view>
</view>
<view class="left1">出发日期:
<view class="liubai">
<picker mode="date" value="value" start="2020-05-18" end="2022-05-17" bindchange="bindDateChange">
<view class="picker">
<div class="dateText">{{date}}</div>
</view>
</picker>
</view>
</view>
------------------------------------
export default {
data() {
return {
time: "12:00",
date: "2020-05-20",
}
},
onLoad: function () {
},
// 点击时间组件确定事件
bindTimeChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
time: e.detail.value
})
},
// 点击日期组件确定事件
bindDateChange: function (e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
}
}
------------------------------------------------------------------------
//main.js
import Vue from 'vue'
import App from './chezhu'
const app = new Vue(App)
app.$mount()
--------------------------------
用Vue这里不value="{{time}}"不给这样写,只能value="value".
底部选择器出来了,但是选择的结果不会更新到页面,说明是:"没有方法“bindTimeChange”来处理事件“Change”.
谁能教下我这个新手,谢谢