fix: layout doesn't refer to url
This commit is contained in:
parent
fd25154725
commit
7e29468247
3 changed files with 16 additions and 2 deletions
|
@ -20,11 +20,11 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$: onlyCard = $page.url.pathname === '/card';
|
$: onlyCard = $page.data.card;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<TestCard full={onlyCard} on:focus={() => goto('/card')} />
|
<TestCard full={onlyCard} on:focus={() => goto('/card')} />
|
||||||
<main class:content={!onlyCard} class:sub={$page.url.pathname !== '/' && !onlyCard}>
|
<main class:content={!onlyCard} class:sub={!$page.data.root && !onlyCard}>
|
||||||
<a href=".." class="button button-back"><i class="ti ti-arrow-back" />Back</a>
|
<a href=".." class="button button-back"><i class="ti ti-arrow-back" />Back</a>
|
||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
|
|
7
src/routes/+page.ts
Normal file
7
src/routes/+page.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
|
export const load: PageLoad = () => {
|
||||||
|
return {
|
||||||
|
root: true
|
||||||
|
}
|
||||||
|
}
|
7
src/routes/card/+page.ts
Normal file
7
src/routes/card/+page.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
|
export const load: PageLoad = () => {
|
||||||
|
return {
|
||||||
|
card: true
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in a new issue