File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
packages/primevue/src/checkbox Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div :class =" cx('root')" v-bind =" getPTOptions('root')" :data-p-checked =" checked" :data-p-indeterminate =" d_indeterminate || undefined" :data-p-disabled =" disabled" :data-p =" dataP" >
3
3
<input
4
+ ref =" input"
4
5
:id =" inputId"
5
6
type =" checkbox"
6
7
:class =" [cx('input'), inputClass]"
15
16
:aria-labelledby =" ariaLabelledby"
16
17
:aria-label =" ariaLabel"
17
18
:aria-invalid =" invalid || undefined"
18
- :aria-checked =" d_indeterminate ? 'mixed' : undefined"
19
19
@focus =" onFocus"
20
20
@blur =" onBlur"
21
21
@change =" onChange"
@@ -55,7 +55,15 @@ export default {
55
55
watch: {
56
56
indeterminate (newValue ) {
57
57
this .d_indeterminate = newValue;
58
- }
58
+
59
+ this .updateIndeterminate ();
60
+ },
61
+ },
62
+ mounted () {
63
+ this .updateIndeterminate ();
64
+ },
65
+ updated () {
66
+ this .updateIndeterminate ();
59
67
},
60
68
methods: {
61
69
getPTOptions (key ) {
@@ -96,6 +104,11 @@ export default {
96
104
onBlur (event ) {
97
105
this .$emit (' blur' , event );
98
106
this .formField .onBlur ? .(event );
107
+ },
108
+ updateIndeterminate () {
109
+ if (this .$refs .input ) {
110
+ this .$refs .input .indeterminate = this .d_indeterminate ;
111
+ }
99
112
}
100
113
},
101
114
computed: {
You can’t perform that action at this time.
0 commit comments