EmailFormField.vue
4 years ago
EmployeeFormField.vue
3 years ago
FirstNameFormField.vue
4 years ago
LastNameFormField.vue
4 years ago
LocationFormField.vue
3 years ago
PhoneFormField.vue
4 years ago
ServiceFormField.vue
2 years ago
FirstNameFormField.vue
59 lines
| 1 | <template> |
| 2 | <!-- First Name --> |
| 3 | <el-form-item |
| 4 | class="am-fs__info-form__item" |
| 5 | prop="firstName" |
| 6 | label-position="top" |
| 7 | > |
| 8 | <template #label> |
| 9 | <span class="am-fs__info-form__label"> |
| 10 | {{ labelsDisplay('first_name_colon') }} |
| 11 | </span> |
| 12 | </template> |
| 13 | <AmInput |
| 14 | v-model="infoFormData.firstName" |
| 15 | name="firstName" |
| 16 | :placeholder="labelsDisplay('enter_first_name')" |
| 17 | ></AmInput> |
| 18 | </el-form-item> |
| 19 | <!-- /First Name --> |
| 20 | </template> |
| 21 | |
| 22 | <script setup> |
| 23 | import AmInput from'../../../_components/input/AmInput.vue' |
| 24 | |
| 25 | import { computed, inject } from "vue"; |
| 26 | |
| 27 | let langKey = inject('langKey') |
| 28 | let amLabels = inject('labels') |
| 29 | |
| 30 | let pageRenderKey = inject('pageRenderKey') |
| 31 | let amCustomize = inject('customize') |
| 32 | |
| 33 | // * Label computed function |
| 34 | function labelsDisplay (label) { |
| 35 | let computedLabel = computed(() => { |
| 36 | return amCustomize.value[pageRenderKey.value].infoStep.translations |
| 37 | && amCustomize.value[pageRenderKey.value].infoStep.translations[label] |
| 38 | && amCustomize.value[pageRenderKey.value].infoStep.translations[label][langKey.value] |
| 39 | ? amCustomize.value[pageRenderKey.value].infoStep.translations[label][langKey.value] |
| 40 | : amLabels[label] |
| 41 | }) |
| 42 | |
| 43 | return computedLabel.value |
| 44 | } |
| 45 | |
| 46 | // * Form field data |
| 47 | let infoFormData = inject('infoFormData') |
| 48 | |
| 49 | </script> |
| 50 | |
| 51 | <script> |
| 52 | export default { |
| 53 | name: "FirstNameFormField" |
| 54 | } |
| 55 | </script> |
| 56 | |
| 57 | <style scoped> |
| 58 | |
| 59 | </style> |