File tree Expand file tree Collapse file tree 3 files changed +19
-15
lines changed
Expand file tree Collapse file tree 3 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,18 @@ const maxLength = computed(() => {
4545 :maxlength =" maxLength"
4646 fluid
4747 />
48- <div class =" flex justify-end mt-1" >
49- <span class =" text-sm text-gray-500" >
50- {{ charCount }}/{{ maxLength }}
51- </span >
52- </div >
5348 </div >
54- <small
55- v-if =" error"
56- :id =" `${input.key}-help`"
57- class =" text-sm mt-0.5 text-red-600"
58- >
59- {{ error }}
60- </small >
49+ <div class =" flex items-start justify-between space-x-1" >
50+ <small
51+ v-if =" error"
52+ :id =" `${input.key}-help`"
53+ class =" text-sm text-red-600"
54+ >
55+ {{ error }}
56+ </small >
57+ <span class =" text-sm text-gray-500 ml-auto float-right" >
58+ {{ charCount }}/{{ maxLength }}
59+ </span >
60+ </div >
6161 </div >
6262</template >
Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ const model = defineModel<string>({ default: '' })
1414const isRequired = computed (() =>
1515 props .input .validations ?.map ((v ) => v .rule ).includes (' required' ),
1616)
17+
1718const maxLength = computed (() => {
1819 const v = props .input ?.validations ?.find (
19- (v : Validation ) => v .rule == ' maxLength' ,
20+ (v : Validation ) => v .rule === ' maxLength' ,
2021 )
21- return v ?.params ? parseInt (v .params [0 ]) : 100
22+ return v ?.params ? parseInt (v .params [0 ]) : undefined
2223})
2324 </script >
2425
Original file line number Diff line number Diff line change 100100 "validations" : [
101101 {
102102 "rule" : " maxLength" ,
103- "params" : [20 ]
103+ "params" : [255 ]
104+ },
105+ {
106+ "rule" : " required"
104107 }
105108 ]
106109 }
You can’t perform that action at this time.
0 commit comments