Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created January 29, 2023 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/fe93c0a69ef48a24a514cae25b94ecce to your computer and use it in GitHub Desktop.
Save kuc-arc-f/fe93c0a69ef48a24a514cae25b94ecce to your computer and use it in GitHub Desktop.
astro + svelet, component sample
---
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>
<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