diff --git a/src/form/star.js b/src/form/star.js index 52bd9d1..08276b2 100644 --- a/src/form/star.js +++ b/src/form/star.js @@ -171,6 +171,7 @@ class Star extends Component { } else { this.value = tmp.i + tmp.f } + this.$emit('input', { value: this.value }) this.$emit('change', { value: this.value }) } } diff --git a/src/form/switch.js b/src/form/switch.js index 8ee6b3b..3a229dc 100644 --- a/src/form/switch.js +++ b/src/form/switch.js @@ -11,8 +11,7 @@ class Switch extends Component { size: 'l', value: { type: Boolean, - default: false, - attribute: false + default: false }, inactiveText: '', activeText: '', @@ -195,11 +194,13 @@ class Switch extends Component { value: this.value } + this.$emit('input') this.$emit('change', data) } handleClick(ev) { if (ev.type === 'click' || ev.keyCode === 32) { + ev.preventDefault() this.toggleCheck(ev) } } diff --git a/src/pager/index.js b/src/pager/index.js index 9191415..b3b9182 100644 --- a/src/pager/index.js +++ b/src/pager/index.js @@ -243,7 +243,8 @@ class Pager extends Component { this.page = num - this.$emit('page-changed', { data: num }) + console.log(this) + this.$emit('page-change', { data: num }) } } @@ -252,9 +253,9 @@ class Pager extends Component { let n = +ev.target.value if (n === n) { this.page = n - this.$emit('page-changed', { data: this.page }) + this.$emit('page-change', { data: n }) } - ev.target.value = this.page + ev.target.value = n } }