be-deslotted
Transfer values from light children to host.
<my-custom-element>
#shadow
<slot name=link be-deslotted=href></slot>
<a slot=link href=https://cnn.com>This is CNN</a>
</my-custom-element>
my-custom-element's href property gets set to https://cnn.com.
If the name of the host property doesn't match the name of the light child property that needs passing, this can be managed via the propMap setting. [TODO]: Show example.
Viewing Locally
- Install git.
- Fork/clone this repo.
- Install node.
- Open command window to folder where you cloned this repo.
-
npm install
-
npm run serve
- Open http://localhost:3030/demo/dev in a modern browser.
Importing in ES Modules:
import 'be-exportable/be-deslotted.js';
Using from CDN:
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-deslotted';
</script>