Skip to content

Commit 148734e

Browse files
author
Hamed
committed
- m_checked added
- minor improvements
1 parent 53d76cc commit 148734e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/PrettyInput.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
5656
data() {
5757
return {
58+
m_checked: undefined,
5859
default_mode: false,
5960
}
6061
},
@@ -85,7 +86,11 @@
8586
return typeof this.modelValue === 'string' ? true : !!this.modelValue;
8687
}
8788
88-
return typeof this.checked === 'string' ? true : !!this.checked;
89+
// this.modelValue === undefined
90+
if(this.m_checked === undefined)
91+
return this.m_checked = typeof this.checked === 'string' ? true : !!this.checked;
92+
else
93+
return this.m_checked;
8994
},
9095
_disabled() {
9196
return typeof this.disabled === 'string' ? true : !!this.disabled;
@@ -161,6 +166,9 @@
161166
},
162167
163168
watch: {
169+
checked(v) {
170+
this.m_checked = v;
171+
},
164172
indeterminate(v) {
165173
this.$refs.input.indeterminate = v;
166174
},
@@ -182,6 +190,8 @@
182190
183191
let isChecked = event.target.checked;
184192
193+
this.m_checked = isChecked;
194+
185195
if (this.modelValue instanceof Array) {
186196
let newValue = [...this.modelValue];
187197

0 commit comments

Comments
 (0)