File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import FieldSelect from '@/fields/input/FieldSelect.vue'
5
5
import FieldRadio from '@/fields/input/FieldRadio.vue'
6
6
import FieldColor from '@/fields/input/FieldColor.vue'
7
7
import FieldNumber from '@/fields/input/FieldNumber.vue'
8
+ import FieldSwitch from '@/fields/input/FieldSwitch.vue'
8
9
9
10
import FieldSubmit from '@/fields/buttons/FieldSubmit.vue'
10
11
import FieldReset from '@/fields/buttons/FieldReset.vue'
11
12
import FieldButton from '@/fields/buttons/FieldButton.vue'
12
- import FieldSwitch from '@/fields/input/FieldSwitch.vue'
13
13
14
14
15
15
const fieldComponents = [
@@ -18,9 +18,14 @@ const fieldComponents = [
18
18
]
19
19
20
20
export default {
21
- install ( app ) {
21
+ install ( app , aliases ) {
22
22
for ( const fieldComponent of fieldComponents ) {
23
- app . component ( fieldComponent . name , fieldComponent )
23
+ const alias = aliases [ fieldComponent . name ]
24
+ if ( alias ) {
25
+ app . component ( alias , fieldComponent )
26
+ } else {
27
+ app . component ( fieldComponent . name , fieldComponent )
28
+ }
24
29
}
25
30
}
26
31
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const VueFormGenerator = {
10
10
install ( app , options ) {
11
11
if ( ! options ) options = { }
12
12
13
- app . use ( FormGeneratorFields )
13
+ app . use ( FormGeneratorFields , options . aliases ?? { } )
14
14
app . component ( 'VueFormGenerator' , FormGenerator )
15
15
16
16
if ( isObject ( options . messages ) ) {
You can’t perform that action at this time.
0 commit comments