File tree 1 file changed +20
-6
lines changed
1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 11
11
>
12
12
<component
13
13
:is =" component"
14
- :key =" transValue "
14
+ :key =" field.fieldname "
15
15
class =" form-control"
16
16
:placeholder =" `Add ${field.label}`"
17
17
:value =" transValue"
18
- @change ="
19
- emitUpdate(field.fieldname, $event.value || $event.target.value)
18
+ v-on ="
19
+ textFields.includes(field.fieldtype)
20
+ ? {
21
+ blur: (event) =>
22
+ emitUpdate(
23
+ field.fieldname,
24
+ event.value || event.target.value
25
+ ),
26
+ }
27
+ : {
28
+ change: (event) =>
29
+ emitUpdate(
30
+ field.fieldname,
31
+ event.value || event.target.value
32
+ ),
33
+ }
20
34
"
21
35
/>
22
36
</div >
@@ -47,6 +61,8 @@ interface E {
47
61
const props = defineProps <P >();
48
62
const emit = defineEmits <E >();
49
63
64
+ const textFields = [" Long Text" , " Small Text" , " Text" ];
65
+
50
66
const component = computed (() => {
51
67
if (props .field .url_method ) {
52
68
return h (Autocomplete , {
@@ -75,9 +91,7 @@ const component = computed(() => {
75
91
},
76
92
],
77
93
});
78
- } else if (
79
- [" Long Text" , " Small Text" , " Text" ].includes (props .field .fieldtype )
80
- ) {
94
+ } else if (textFields .includes (props .field .fieldtype )) {
81
95
return h (FormControl , {
82
96
type: " textarea" ,
83
97
});
You can’t perform that action at this time.
0 commit comments