diff --git a/packages/switch/src/component.vue b/packages/switch/src/component.vue index cf62a03f3..abe404048 100644 --- a/packages/switch/src/component.vue +++ b/packages/switch/src/component.vue @@ -111,6 +111,7 @@ }, watch: { checked() { + this.$refs.input.checked = this.checked; if (this.onColor || this.offColor) { this.setBackgroundColor(); } diff --git a/test/unit/specs/switch.spec.js b/test/unit/specs/switch.spec.js index e28a93c6a..eac43fb23 100644 --- a/test/unit/specs/switch.spec.js +++ b/test/unit/specs/switch.spec.js @@ -175,4 +175,29 @@ describe('Switch', () => { }, 10); }, 10); }); + + it('sets checkbox value', done => { + vm = createVue({ + template: ` +