From 6bbef91c402eaa58b8a4d8f11c466a39802ca0ca Mon Sep 17 00:00:00 2001
From: 劉鈞霖 <benson@gmail.com>
Date: 星期二, 28 十二月 2021 14:50:13 +0800
Subject: [PATCH] [ Ref ] : 重構 共用資料夾 相關元件

---
 PAMapp/components/Ui/UiField.vue |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/PAMapp/components/Ui/UiField.vue b/PAMapp/components/Ui/UiField.vue
index 588af8d..b7d1192 100644
--- a/PAMapp/components/Ui/UiField.vue
+++ b/PAMapp/components/Ui/UiField.vue
@@ -14,17 +14,34 @@
 <script lang="ts">
 import { Vue, Component, Prop } from 'vue-property-decorator';
 
-@Component
-export default class UiCarousel extends Vue {
+import UtilsService from '~/shared/services/utils.service';
 
-  @Prop() span!: number;
-  @Prop() icon!: string;
-  @Prop() label!: string;
-  @Prop() content!: string;
-  @Prop() displayDevice!: 'MOBILE' | 'DESKTOP' | 'ALL';
+@Component
+export default class UiField extends Vue {
+
+  @Prop()
+  span!: number;
+
+  @Prop()
+  icon!: string;
+
+  @Prop()
+  label!: string;
+
+  @Prop()
+  content!: string;
+
+  @Prop()
+  displayDevice!: 'MOBILE' | 'DESKTOP' | 'ALL';
 
   currentDevice: 'MOBILE' | 'DESKTOP' = 'MOBILE';
 
+  //////////////////////////////////////////////////////////////////
+
+  mounted(): void {
+    this.currentDevice = UtilsService.isMobileDevice() ? 'MOBILE' : 'DESKTOP';
+  }
+
   get fieldSpan(): number {
     return this.span || 24;
   }

--
Gitblit v1.8.0