File tree 2 files changed +20
-3
lines changed
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ export const formItemProps = () => ({
102
102
messageVariables : { type : Object as PropType < Record < string , string > > } ,
103
103
hidden : Boolean ,
104
104
noStyle : Boolean ,
105
+ disabled : Boolean ,
105
106
} ) ;
106
107
107
108
export type FormItemProps = Partial < ExtractPropTypes < ReturnType < typeof formItemProps > > > ;
@@ -250,7 +251,9 @@ export default defineComponent({
250
251
) ;
251
252
validateState . value = 'validating' ;
252
253
errors . value = [ ] ;
253
-
254
+ if ( props . disabled ) {
255
+ return Promise . resolve ( ) ;
256
+ }
254
257
promise
255
258
. catch ( e => e )
256
259
. then ( ( results : RuleError [ ] = [ ] ) => {
@@ -408,6 +411,8 @@ export default defineComponent({
408
411
v-slots = { {
409
412
default : ( ) => (
410
413
< >
414
+ { /* disable */ }
415
+ { props . disabled ? < div class = { [ `${ prefixCls . value } -item-disabled` ] } > </ div > : '' }
411
416
{ /* Label */ }
412
417
< FormItemLabel
413
418
{ ...props }
Original file line number Diff line number Diff line change 59
59
// ================================================================
60
60
.@{form-item-prefix-cls} {
61
61
.reset-component ();
62
-
62
+ position : relative ;
63
63
margin-bottom : @form-item-margin-bottom ;
64
64
vertical-align : top ;
65
65
74
74
display : none ;
75
75
}
76
76
77
+ &-disabled {
78
+ // https://github.com/vueComponent/ant-design-vue/issues/6374
79
+ .disabled ();
80
+ width : 100% ;
81
+ height : 100% ;
82
+ z-index : 99 ;
83
+ position : absolute ;
84
+ background : none ;
85
+ }
86
+
77
87
// ==============================================================
78
88
// = Label =
79
89
// ==============================================================
110
120
}
111
121
112
122
// Required mark
113
- & .@{form-item-prefix-cls} -required :not (.@{form-item-prefix-cls} -required-mark-optional )::before {
123
+ & .@{form-item-prefix-cls} -required :not (
124
+ .@{form-item-prefix-cls} -required-mark-optional
125
+ )::before {
114
126
display : inline-block ;
115
127
margin-right : 4px ;
116
128
color : @label-required-color ;
You can’t perform that action at this time.
0 commit comments