This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 99 <div class =" relative card p-6 bg-white" >
1010 <h1 class =" title mb-16 text-bg" >{{ title }}</h1 >
1111 <dynamic-form
12+ class =" awiwi"
1213 :form =" form"
1314 @submitted =" handleSubmit"
1415 @change =" valueChanged"
@@ -245,6 +246,9 @@ export default defineComponent({
245246 readonly: true ,
246247 }),
247248 },
249+ options: {
250+ customClass: ' mandalorian' ,
251+ },
248252 }));
249253
250254 function handleSubmit(values ) {
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ const components = {
8282 */
8383export default defineComponent ({
8484 name: ' asDynamicForm' ,
85- inheritAttrs: false ,
8685 props ,
8786 components ,
8887 setup(props , ctx ) {
@@ -141,15 +140,20 @@ export default defineComponent({
141140 });
142141
143142 const formattedOptions = computed (() => {
144- if (options ?.form ) {
143+ let opts = {
144+ ... options ?.form ,
145+ ... props .form ?.options ,
146+ };
147+
148+ if (opts ) {
145149 const {
146150 customClass,
147151 customStyles,
148152 method,
149153 netlify,
150154 netlifyHoneypot,
151155 autocomplete,
152- } = options ?. form ;
156+ } = opts ;
153157 return {
154158 class: customClass ,
155159 style: customStyles ,
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface DynamicForm {
2626 id : string ;
2727 fields : FormFields ;
2828 fieldOrder ?: string [ ] ;
29+ options ?: FormOptions ;
2930}
3031
3132export interface ErrorMessage {
@@ -151,8 +152,8 @@ export type FormControl<T extends InputType> = T & {
151152} ;
152153
153154export 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 ;
156157 method ?: string ;
157158 netlify ?: boolean ;
158159 netlifyHoneypot ?: string ;
You can’t perform that action at this time.
0 commit comments