mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-21 13:31:52 +00:00
Rename checked variable
This commit is contained in:
parent
2dadaad0b6
commit
5044f35d26
1 changed files with 6 additions and 9 deletions
|
|
@ -23,16 +23,13 @@
|
|||
data() {
|
||||
return {
|
||||
hasSlot: true,
|
||||
isChecked: this.value
|
||||
checked: this.value
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
checked() {
|
||||
return this.value;
|
||||
},
|
||||
classes() {
|
||||
return {
|
||||
'md-checked': Boolean(this.checked),
|
||||
'md-checked': Boolean(this.value),
|
||||
'md-disabled': this.disabled
|
||||
};
|
||||
}
|
||||
|
|
@ -40,15 +37,15 @@
|
|||
methods: {
|
||||
toggleCheck() {
|
||||
if (!this.disabled) {
|
||||
this.isChecked = !this.isChecked;
|
||||
this.$emit('change', this.isChecked);
|
||||
this.$emit('input', this.isChecked);
|
||||
this.checked = !this.checked;
|
||||
this.$emit('change', this.checked);
|
||||
this.$emit('input', this.checked);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value) {
|
||||
this.isChecked = true;
|
||||
this.checked = true;
|
||||
}
|
||||
|
||||
this.hasSlot = this.$el.querySelector('label').innerHTML.trim() !== '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue