-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug do sveltekit contornado sveltejs/kit#8676
- Loading branch information
Showing
8 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script lang="ts"> | ||
export let href: string; | ||
function click(path: string, e: MouseEvent){ | ||
if(import.meta.env.DEV) return; | ||
e.preventDefault(); | ||
window.location.href = `${path}.html`; | ||
} | ||
</script> | ||
|
||
<a href={href} on:click={(e) => click(href, e)}> | ||
<slot /> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function load() { | ||
return { | ||
posts: ['testezinho', 'eae'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
<h1>Blog</h1> | ||
<script lang="ts"> | ||
import Link from "../../components/Link.svelte"; | ||
|
||
export let data: {posts: string[]}; | ||
</script> | ||
|
||
<h1>Blog</h1> | ||
{#each data.posts as post} | ||
<Link | ||
href={`/blog/${post}`} | ||
>post</Link> | ||
{/each} | ||
<!-- on:click={(e) => clickPost(post, e)} --> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function redirectTo(path: string, e: MouseEvent){ | ||
e.preventDefault(); | ||
window.location.href = path; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters