mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-16 03:03:11 +00:00
Merge pull request #50 from kristianmandrup/master
pass on DOM event for checkbox and radio
This commit is contained in:
commit
dd8773f5ac
2 changed files with 8 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="md-checkbox" :class="classes">
|
||||
<div class="md-checkbox-container" @click="toggleCheck" v-md-ink-ripple="disabled">
|
||||
<div class="md-checkbox-container" @click="toggleCheck($event)" v-md-ink-ripple="disabled">
|
||||
<input type="checkbox" :name="name" :id="id" :disabled="disabled" :value="value">
|
||||
</div>
|
||||
|
||||
|
|
@ -34,11 +34,11 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
toggleCheck() {
|
||||
toggleCheck($event) {
|
||||
if (!this.disabled) {
|
||||
this.checked = !this.checked;
|
||||
this.$emit('change', this.checked);
|
||||
this.$emit('input', this.checked);
|
||||
this.$emit('change', this.checked, $event);
|
||||
this.$emit('input', this.checked, $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="md-radio" :class="classes">
|
||||
<div class="md-radio-container" @click="toggleCheck" v-md-ink-ripple="disabled">
|
||||
<div class="md-radio-container" @click="toggleCheck($event)" v-md-ink-ripple="disabled">
|
||||
<input type="radio" :name="name" :id="id" :disabled="disabled" :value="value">
|
||||
</div>
|
||||
|
||||
|
|
@ -33,10 +33,10 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
toggleCheck() {
|
||||
toggleCheck($event) {
|
||||
if (!this.disabled) {
|
||||
this.$emit('change', this.mdValue);
|
||||
this.$emit('input', this.mdValue);
|
||||
this.$emit('change', this.mdValue, $event);
|
||||
this.$emit('input', this.mdValue, $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue