This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree 3 files changed +14
-5
lines changed
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 9
9
<div class =" relative card p-6 bg-white" >
10
10
<h1 class =" title mb-16 text-bg" >{{ title }}</h1 >
11
11
<dynamic-form
12
+ class =" awiwi"
12
13
:form =" form"
13
14
@submitted =" handleSubmit"
14
15
@change =" valueChanged"
@@ -245,6 +246,9 @@ export default defineComponent({
245
246
readonly: true ,
246
247
}),
247
248
},
249
+ options: {
250
+ customClass: ' mandalorian' ,
251
+ },
248
252
}));
249
253
250
254
function handleSubmit(values ) {
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ const components = {
82
82
*/
83
83
export default defineComponent ({
84
84
name: ' asDynamicForm' ,
85
- inheritAttrs: false ,
86
85
props ,
87
86
components ,
88
87
setup(props , ctx ) {
@@ -141,15 +140,20 @@ export default defineComponent({
141
140
});
142
141
143
142
const formattedOptions = computed (() => {
144
- if (options ?.form ) {
143
+ let opts = {
144
+ ... options ?.form ,
145
+ ... props .form ?.options ,
146
+ };
147
+
148
+ if (opts ) {
145
149
const {
146
150
customClass,
147
151
customStyles,
148
152
method,
149
153
netlify,
150
154
netlifyHoneypot,
151
155
autocomplete,
152
- } = options ?. form ;
156
+ } = opts ;
153
157
return {
154
158
class: customClass ,
155
159
style: customStyles ,
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface DynamicForm {
26
26
id : string ;
27
27
fields : FormFields ;
28
28
fieldOrder ?: string [ ] ;
29
+ options ?: FormOptions ;
29
30
}
30
31
31
32
export interface ErrorMessage {
@@ -151,8 +152,8 @@ export type FormControl<T extends InputType> = T & {
151
152
} ;
152
153
153
154
export interface FormOptions {
154
- customClass ?: string | string [ ] | BindingObject | BindingObject [ ] ;
155
- customStyles ?: string | string [ ] | BindingObject | BindingObject [ ] ;
155
+ customClass ?: string | string [ ] | BindingObject | BindingObject [ ] | unknown ;
156
+ customStyles ?: string | string [ ] | BindingObject | BindingObject [ ] | unknown ;
156
157
method ?: string ;
157
158
netlify ?: boolean ;
158
159
netlifyHoneypot ?: string ;
You can’t perform that action at this time.
0 commit comments