crm/frontend/src/App.vue
Shariq Ansari b1dfa6e9c9 fix: remount on route change with param and hash change
(cherry picked from commit 4acb4dd3a70c8aed5f8613a2db827a5441ea6148)
2025-07-30 12:44:41 +00:00

36 lines
958 B
Vue

<template>
<FrappeUIProvider>
<Layout v-if="session().isLoggedIn">
<router-view :key="$route.fullPath"/>
</Layout>
<Dialogs />
</FrappeUIProvider>
</template>
<script setup>
import { Dialogs } from '@/utils/dialogs'
import { sessionStore as session } from '@/stores/session'
import { setTheme } from '@/stores/theme'
import { FrappeUIProvider, setConfig } from 'frappe-ui'
import { computed, defineAsyncComponent, onMounted } from 'vue'
const MobileLayout = defineAsyncComponent(
() => import('./components/Layouts/MobileLayout.vue'),
)
const DesktopLayout = defineAsyncComponent(
() => import('./components/Layouts/DesktopLayout.vue'),
)
const Layout = computed(() => {
if (window.innerWidth < 640) {
return MobileLayout
} else {
return DesktopLayout
}
})
onMounted(() => setTheme())
setConfig('systemTimezone', window.timezone?.system || null)
setConfig('localTimezone', window.timezone?.user || null)
</script>