Skip to content

Commit 4dab16c

Browse files
veebuveuvl
authored andcommitted
ability to tag values, add sync blocker (euvl#107)
1 parent 4a60d4d commit 4dab16c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/Button.vue

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export default {
7070
type: Boolean,
7171
default: false
7272
},
73+
tag: {
74+
type: String,
75+
},
7376
sync: {
7477
type: Boolean,
7578
default: false
@@ -269,14 +272,18 @@ export default {
269272
}
270273
},
271274
methods: {
272-
toggle (event) {
273-
this.toggled = !this.toggled
274-
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);
275281
this.$emit('change', {
276-
value: this.toggled,
277-
srcEvent: event
278-
})
279-
}
282+
value: toggled,
283+
tag: this.tag,
284+
srcEvent: event,
285+
});
286+
},
280287
}
281288
}
282289
</script>

0 commit comments

Comments
 (0)