svelte-show

0.0.5 • Public • Published

svelte-show

Like v-show in vuejs, or ng-show in angularjs, svelte-show just hide the element, it does not destroy the components inside its block. This library is used for cases when we need to keep the HTML elements retain in DOM, to avoid re-initialization when working with some 3rd libraries.

Usage

<script>
  import Show from "svelte-show/Show.svelte";
  let show = true;
</script>
<button on:click={() => { show = !show}}>
  Click to Show/Hide Content
</button>
<Show {show}>
  <div>Content</div>
</Show>

For TypeScript, import the same way:

<script lang="ts">
  import Show from "svelte-show/Show.svelte";
  ...

Readme

Keywords

Package Sidebar

Install

npm i svelte-show

Weekly Downloads

1

Version

0.0.5

License

none

Unpacked Size

3.45 kB

Total Files

5

Last publish

Collaborators

  • foxeye.rinx