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