element icon indicating copy to clipboard operation
element copied to clipboard

DatePicker 时间控件如何对change事件添加绑定啊

Open tandajun opened this issue 10 years ago • 3 comments

如题

tandajun avatar Nov 29 '16 06:11 tandajun

我能想到的方法只有利用id或者一些属性,对dom绑定change事件~~ document.getElementById('datePick').firstChild.setAttribute('onchange','cb()'); 实践后 发现当我修改控件中的值时 控件应该是利用了dom赋值,所以并不会触发change事件, 求助啊~~

tandajun avatar Nov 29 '16 07:11 tandajun

我想到了可以利用watch来监听vm中这个值得变化,不过还是希望能够日后能新增一些事件属性!

tandajun avatar Nov 29 '16 08:11 tandajun

目前 DatePicker 没有提供 change 事件,使用 watch 是正确的做法。

Leopoldthecoder avatar Nov 29 '16 09:11 Leopoldthecoder