From 54f9eba1c719ccad8e05a318f33fdf39e53531fb Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 06 十一月 2021 16:01:06 +0800 Subject: [PATCH] update: [UiField] 實作 displayDevice api --- PAMapp/components/Ui/UiField.vue | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/PAMapp/components/Ui/UiField.vue b/PAMapp/components/Ui/UiField.vue index 588af8d..5d5ee7b 100644 --- a/PAMapp/components/Ui/UiField.vue +++ b/PAMapp/components/Ui/UiField.vue @@ -13,9 +13,10 @@ <script lang="ts"> import { Vue, Component, Prop } from 'vue-property-decorator'; +import { isMobileDevice } from '~/assets/ts/device'; @Component -export default class UiCarousel extends Vue { +export default class UiField extends Vue { @Prop() span!: number; @Prop() icon!: string; @@ -25,6 +26,10 @@ currentDevice: 'MOBILE' | 'DESKTOP' = 'MOBILE'; + mounted(): void { + this.currentDevice = isMobileDevice() ? 'MOBILE' : 'DESKTOP'; + } + get fieldSpan(): number { return this.span || 24; } -- Gitblit v1.8.0