svelte-fragment
v1.0.1
Published
Svelte action to render components and elements in slots without DOM containers
Downloads
34
Readme
Svelte fragment action
Svelte action to render components and elements in slots without DOM containers.
Installation:
npm i svelte-fragment
Usage:
<script>
import Wrapper from './Wrapper.svelte';
import Component from './Component.svelte';
import fragment from 'svelte-fragment';
</script>
<Wrapper>
<!-- Component will be rendered without wrapper `template` -->
<template use:fragment slot="content" let:data>
<Component {data} />
</template>
</Wrapper>