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