Created
January 29, 2023 04:51
-
-
Save kuc-arc-f/fe93c0a69ef48a24a514cae25b94ecce to your computer and use it in GitHub Desktop.
astro + svelet, component sample
This file contains hidden or 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
--- | |
import Test1 from '../components/test1.svelte'; | |
console.log('#server'); | |
--- | |
<!-- MarkUp --> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<meta name="generator" content={Astro.generator} /> | |
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | |
<style> | |
html, | |
body { | |
font-family: system-ui; | |
margin: 0; | |
} | |
body { | |
padding: 2rem; | |
} | |
</style> | |
</head> | |
<body> | |
<main> | |
<h1>Test.astro</h1> | |
<hr /> | |
<Test1 client:visible name={"hoge1"} > | |
<p>Hello, Svelte!</p> | |
</Test1> | |
<Test1 client:visible name={22} > | |
<p>Hello, Svelte!</p> | |
</Test1> | |
</main> | |
</body> | |
</html> |
This file contains hidden or 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
<script lang="ts"> | |
export let name; | |
console.log("name=", name); | |
</script> | |
<!-- MarkUp --> | |
<h3>test1.svelte</h3> | |
<p>name= {name}</p> | |
<div class="message"> | |
<slot /> | |
</div> | |
<hr /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment