npm.io
0.0.44 • Published 3 years ago

be-deslotted

Licence
MIT
Version
0.0.44
Deps
4
Size
11 kB
Vulns
0
Weekly
0

be-deslotted

Transfer values from light children to host.

Actions Status How big is this package in your project?

<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

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. 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>

Keywords