diff --git a/resources/js/Pages/Album/Index.vue b/resources/js/Pages/Album/Index.vue index 1919dc9..f632523 100644 --- a/resources/js/Pages/Album/Index.vue +++ b/resources/js/Pages/Album/Index.vue @@ -3,7 +3,8 @@ import { Head } from '@inertiajs/vue3'; import Layout from '@/Layouts/Layout.vue'; import Create from './Partials/Create.vue'; import Show from'./Partials/Show.vue'; -import { reactive } from 'vue'; +import { onMounted, reactive } from 'vue'; +import Platform from '@/platform'; const props = defineProps({ albums: { @@ -27,6 +28,11 @@ const listView = () => { viewState.list = true; } +onMounted(() => { + if(Platform.detect() == "mobile") { + listView(); + } +}); const gridState = reactive({ columns: 3 }); diff --git a/resources/js/Pages/Album/Show.vue b/resources/js/Pages/Album/Show.vue index e1f7a13..b75327b 100644 --- a/resources/js/Pages/Album/Show.vue +++ b/resources/js/Pages/Album/Show.vue @@ -4,8 +4,9 @@ import Layout from '@/Layouts/Layout.vue'; import Create from '@/Pages/Photo/Partials/Create.vue'; import Show from'@/Pages/Photo/Partials/Show.vue'; import Modal from '@/Pages/Photo/Partials/Modal.vue'; -import { reactive, ref } from 'vue'; +import { onMounted, reactive, ref } from 'vue'; import Panel from '../Photo/Partials/Panel.vue'; +import Platform from '@/platform'; const props = defineProps({ album: { @@ -92,6 +93,13 @@ const toggle = () => { document.querySelector('#affichage').classList.toggle('hidden'); document.querySelector('#affichage').classList.toggle('flex'); } + +onMounted(() => { + if(Platform.detect() == "mobile") { + listView(); + toggle(); + } +});