t2ym / i18n-element

I18N Base Element for Lit and Polymer
Other
9 stars 1 forks source link

[demo] <shadow-repeat> element to avoid disconnection on selective drawing #86

Closed t2ym closed 5 years ago

t2ym commented 5 years ago

[demo] <shadow-repeat> element to avoid disconnection on selective drawing

Usage

html`${bind(this)}
<shadow-repeat 
  .repeater=${() => repeat(this.items, (item, index) => html`<slot name=${index}>`)}>
  <!-- stock views in Light DOM and show selected in shadow DOM via slot names -->
  ${repeat(this.items,
   (item, index) => index,
   (item, index) => html`<item-element slot=${index} .data=${item}></item-element>`)}
</shadow-repeat>`;