sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

A problem about _layout.svelte? #1763

Closed jakholuo closed 3 years ago

jakholuo commented 3 years ago

When i use _layout.svelte in second-level routes directory,, like:

-routes --_layout.svelte --about ---_layout.svelte ---index.svelte

// routes/about/_layout.svelte

<slot />
// routes/about/index.svelte
<script>
  function handleClick(event) {
    alert(1);
  }
</script>

<div>
  <button on:click={handleClick}>Submit</button>
</div>

click the button , alert is not show!

but when i remove the file _layout.svelte , it is work.

I don't know how to solve this problem, hope to get help~thanks~