- 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)
16 lines
549 B
TypeScript
16 lines
549 B
TypeScript
// Lets a view ask App to remount the current route's component in place:
|
|
// App keys the routed view by path plus this revision, so bumping it gives
|
|
// the view a fresh instance without a navigation (Create and new on a
|
|
// create form opens a blank form at the same path).
|
|
import { readonly, ref } from 'vue'
|
|
|
|
const revision = ref(0)
|
|
|
|
/** Part of App's routed view key; bumped by remountView. */
|
|
export const remountRevision = readonly(revision)
|
|
|
|
/** Remounts the current route's view. */
|
|
export function remountView(): void {
|
|
revision.value++
|
|
}
|