| | |
| | | <template> |
| | | <el-col :span="24" class="pam-field"> |
| | | <div class="pam-field-label"> |
| | | <div class="pam-field-title"><i :class="fieldIcon"></i>{{ fieldLabel }}</div> |
| | | <el-col :span="fieldSpan" class="pam-field" |
| | | v-if="fieldDisplayDevice === 'ALL' |
| | | || fieldDisplayDevice === currentDevice"> |
| | | <div class="pam-field__label"> |
| | | <div class="pam-field__title"><i :class="fieldIcon"></i>{{ fieldLabel }}</div> |
| | | </div> |
| | | <p class="pam-field-content pt-10"> |
| | | <p class="pam-field__content"> |
| | | <slot></slot> |
| | | </p> |
| | | </el-col> |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { Vue, Component, Prop } from 'vue-property-decorator'; |
| | | import { isMobileDevice } from '~/shared/device'; |
| | | |
| | | @Component |
| | | export default class UiCarousel extends Vue { |
| | | export default class UiField extends Vue { |
| | | |
| | | @Prop() span!: number; |
| | | @Prop() icon!: string; |
| | | @Prop() label!: string; |
| | | @Prop() content!: string; |
| | | // @Prop() displayDevice!: 'MOBILE' | 'DESKTOP'; |
| | | @Prop() displayDevice!: 'MOBILE' | 'DESKTOP' | 'ALL'; |
| | | |
| | | currentDevice: 'MOBILE' | 'DESKTOP' = 'MOBILE'; |
| | | |
| | | mounted(): void { |
| | | this.currentDevice = isMobileDevice() ? 'MOBILE' : 'DESKTOP'; |
| | | } |
| | | |
| | | get fieldSpan(): number { |
| | | return this.span || 24; |
| | |
| | | return `${this.label}`; |
| | | } |
| | | |
| | | get fieldDisplayDevice(): 'MOBILE' | 'DESKTOP' | 'ALL' { |
| | | return this.displayDevice || 'ALL'; |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | |
| | | .pam-field { |
| | | display: flex; |
| | | flex-direction: column; |
| | | .pam-field-label { |
| | | .pam-field__label { |
| | | display: flex; |
| | | align-items: center; |
| | | .pam-icon { |
| | | font-size: 12px; |
| | | } |
| | | .pam-field-title { |
| | | .pam-field__title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | .pam-field__content { |
| | | padding-top: 10px; |
| | | } |
| | | } |
| | | </style> |