Fixed render bug

This commit is contained in:
jableader 2025-11-02 16:43:33 +11:00
parent db9f364472
commit 90a2ffc5de
2 changed files with 16 additions and 3 deletions

View file

@ -9,6 +9,17 @@ Status of tests and typing
Prerequisites Prerequisites
- Node.js 20.19.0 LTS or newer (chrome-devtools-mcp requires >=20.19.0). An `.nvmrc` file is provided; run `nvm use` to switch. - Node.js 20.19.0 LTS or newer (chrome-devtools-mcp requires >=20.19.0). An `.nvmrc` file is provided; run `nvm use` to switch.
## Test credentials for manual QA (Nov 2, 2025)
- Email: specuser+20251102@example.com
- Display Name: Spec User
- Password: SpecPassw0rd!
- Household slug: faulconfridge-qa2
Notes
- Created via live browser flow; redirected to slug-scoped app shell.
- Verified Meal Plan and Shopping pages load under `/:householdSlug` without missing-param errors.
# Frontend Specification: Household Multi-Tenancy (v2) # Frontend Specification: Household Multi-Tenancy (v2)
## 1. Objective ## 1. Objective

View file

@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory, createMemoryHistory, Router } from 'vue-router' import { createRouter, createWebHashHistory, createMemoryHistory, Router, RouterView } from 'vue-router'
import { setHouseholdSlugProvider } from '@/api/client' import { setHouseholdSlugProvider } from '@/api/client'
import type { RouteRecordRaw } from 'vue-router' import type { RouteRecordRaw } from 'vue-router'
@ -38,9 +38,11 @@ export function createAppRouter(getCurrentUser: () => Promise<unknown> | unknown
] ]
const routes: RouteRecordRaw[] = [] const routes: RouteRecordRaw[] = []
routes.push({ path: '/', name: 'root', component: { template: '<div />' }, meta: { requiresAuth: true } }) // Avoid runtime template compilation by using render functions/components
const Empty = { render: () => null }
routes.push({ path: '/', name: 'root', component: Empty, meta: { requiresAuth: true } })
routes.push(...publicRoutes) routes.push(...publicRoutes)
routes.push({ path: '/:householdSlug', component: { template: '<router-view />' }, children: featureChildren }) routes.push({ path: '/:householdSlug', component: RouterView, children: featureChildren })
// Use hash history in real browsers; fallback to memory history in tests/SSR where `globalThis.location` may be unavailable // Use hash history in real browsers; fallback to memory history in tests/SSR where `globalThis.location` may be unavailable
// Some test runners may polyfill `window` but not the global `location`, and vue-router's hash history uses the global. // Some test runners may polyfill `window` but not the global `location`, and vue-router's hash history uses the global.