| 123456789101112131415161718192021222324 |
- var _ = require('../../util')
- module.exports = {
- bind: function () {
- var self = this
- var el = this.el
- this.listener = function () {
- self.set(el.checked)
- }
- _.on(el, 'change', this.listener)
- if (el.checked) {
- this._initValue = el.checked
- }
- },
- update: function (value) {
- this.el.checked = !!value
- },
- unbind: function () {
- _.off(this.el, 'change', this.listener)
- }
- }
|