Files
summercms/admin/src/App.vue
Jakub Zych 49accf675e feat(quick-261022-k9k): admin save shortcuts and Create and new on record forms
- app/hotkeys.ts: dependency-free data-hotkey core (Ctrl/Cmd+S, Ctrl/Cmd+Enter,
  Ctrl/Cmd+Shift+S, Esc, / and ?), innermost-modal root, capture-phase modifier
  listener, platform labels and the help-dialog state
- Button hotkey prop (data-hotkey, aria-keyshortcuts); shortcuts installed by AppShell
- FormView: save keys and tooltips, Create and new on create forms via remountView
- phrasebook: form.create_and_new and the shortcuts group (en, pl)
2026-10-22 21:00:57 +02:00

28 lines
953 B
Vue

<script setup lang="ts">
import { computed, watchEffect } from 'vue'
import { RouterView, useRoute } from 'vue-router'
import { documentTitleForRoute } from './app/pageTitle'
import AppShell from './components/shell/AppShell.vue'
import { remountRevision } from './state/useRemount'
const route = useRoute()
const inShell = computed(() => route.meta.shell === true)
watchEffect(() => {
document.title = documentTitleForRoute(route)
})
</script>
<template>
<!-- Keyed by path, not full path: a new controller or record remounts its
view, while list query changes (search, sort, page) keep it. The
remount revision is part of the key, so a view can remount itself in
place (Create and new). -->
<AppShell v-if="inShell">
<RouterView v-slot="{ Component, route: current }">
<component :is="Component" :key="`${current.path}#${remountRevision}`" />
</RouterView>
</AppShell>
<RouterView v-else />
</template>