This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +13
-3
lines changed Expand file tree Collapse file tree 6 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ const data = () => ({
147147 customClass: ' col-12' ,
148148 }),
149149 new FormField ({
150+ id: ' number-custom-id' ,
150151 type: ' number' ,
151152 label: ' Number' ,
152153 name: ' number' ,
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const methods = {
3434 field =>
3535 new FormControl ( {
3636 ...field ,
37+ form : this . id ,
3738 } ) ,
3839 ) ;
3940 } ,
@@ -42,6 +43,7 @@ const methods = {
4243 field =>
4344 new FormControl ( {
4445 ...field ,
46+ form : this . id ,
4547 } ) ,
4648 ) ;
4749 } ,
@@ -63,6 +65,7 @@ const methods = {
6365 field =>
6466 new FormControl ( {
6567 ...field ,
68+ form : this . id ,
6669 valid : true ,
6770 value : null ,
6871 touched : false ,
Original file line number Diff line number Diff line change 11<template >
22 <select
3- :id =" formControl.name "
3+ :id =" formControl.id "
44 v-model =" formControl.value"
55 :name =" formControl.name"
66 class =" form-control"
Original file line number Diff line number Diff line change 11<template >
22 <input
3- :id =" formControl.name "
3+ :id =" formControl.id "
44 v-model =" formControl.value"
55 :name =" formControl.name"
66 class =" form-control"
Original file line number Diff line number Diff line change 11<template >
22 <textarea
3- :id =" formControl.name "
3+ :id =" formControl.id "
44 v-model =" formControl.value"
55 :name =" formControl.name"
66 class =" form-control"
Original file line number Diff line number Diff line change 11export function FormControl ( {
2+ id,
23 type = null ,
34 value = null ,
45 validations = [ ] ,
56 label = null ,
7+ form,
68 name = null ,
79 customClass = null ,
810 options = [ ] ,
@@ -14,7 +16,9 @@ export function FormControl({
1416 touched = false ,
1517 dirty = false ,
1618} ) {
19+ this . id = id || `${ form } -${ name } ` ;
1720 this . type = type ;
21+ this . form = form ;
1822 this . value = value ;
1923 this . validations = validations ;
2024 this . label = label ;
@@ -31,6 +35,7 @@ export function FormControl({
3135}
3236
3337export function FormField ( {
38+ id,
3439 type = 'text' ,
3540 value = null ,
3641 validations = [ ] ,
@@ -44,6 +49,7 @@ export function FormField({
4449 rows = null ,
4550 cols = null ,
4651} ) {
52+ this . id = id ;
4753 this . type = type ;
4854 this . value = value ;
4955 this . validations = validations ;
You can’t perform that action at this time.
0 commit comments