File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ export default {
2424 } ,
2525 mounted ( ) {
2626 this . setValidatorLanguage ( ) ;
27- this . updateValidation ( )
27+ this . updateValidation ( ) ;
28+ this . observeElementMutations ( ) ;
2829 } ,
2930 watch : {
3031 // Triggered whenever the v-model is updated
@@ -52,6 +53,20 @@ export default {
5253 }
5354 } ,
5455 methods : {
56+ observeElementMutations ( ) {
57+ new MutationObserver ( this . handleMutations ) . observe ( this . $el , {
58+ attributes : true ,
59+ attributeFilter : [ 'readonly' , 'disabled' ] ,
60+ subtree : true
61+ } ) ;
62+ } ,
63+ handleMutations ( mutations ) {
64+ mutations . forEach ( mutation => {
65+ if ( mutation . type == "attributes" ) {
66+ this . updateValidation ( )
67+ }
68+ } ) ;
69+ } ,
5570 setValidatorLanguage ( ) {
5671 let globalObject = typeof window === 'undefined' ? global : window ;
5772
You can’t perform that action at this time.
0 commit comments