There was an error while loading. Please reload this page.
1 parent 4a60d4d commit 4dab16cCopy full SHA for 4dab16c
src/Button.vue
@@ -70,6 +70,9 @@ export default {
70
type: Boolean,
71
default: false
72
},
73
+ tag: {
74
+ type: String,
75
+ },
76
sync: {
77
78
@@ -269,14 +272,18 @@ export default {
269
272
}
270
273
271
274
methods: {
- toggle (event) {
- this.toggled = !this.toggled
- this.$emit('input', this.toggled)
275
+ toggle(event) {
276
+ const toggled = !this.toggled;
277
+ if (!this.sync) {
278
+ this.toggled = toggled;
279
+ }
280
+ this.$emit('input', toggled);
281
this.$emit('change', {
- value: this.toggled,
- srcEvent: event
- })
- }
282
+ value: toggled,
283
+ tag: this.tag,
284
+ srcEvent: event,
285
+ });
286
287
288
289
</script>
0 commit comments