Set up Form component & some form elements components

This commit is contained in:
Bubka
2023-09-27 10:37:59 +02:00
parent c02af5aab9
commit 1d51cb3e31
10 changed files with 839 additions and 6 deletions

View File

@ -0,0 +1,34 @@
// import { ref } from 'vue'
export function useIdGenerator(fieldType, fieldName) {
let prefix
fieldName = fieldName.toString()
switch (fieldType) {
case 'text':
prefix = 'txt'
break
case 'button':
prefix = 'btn'
break
case 'email':
prefix = 'eml'
break
case 'password':
prefix = 'pwd'
break
case 'radio':
prefix = 'rdo'
break
case 'label':
prefix = 'lbl'
break
default:
prefix = 'txt'
break
}
return {
inputId: prefix + fieldName[0].toUpperCase() + fieldName.toLowerCase().slice(1)
}
}