Injection of sub-component in Web Component -
suppose creating component template contains special sub-components. example:
<x-audio-player playlist-json="my_js_list"></x-audio-player>
with shadow dom
<x-playlist> <x-track name="track 1"></xtrack> <x-track name="track 2"></xtrack> <x-track name="track 3"></xtrack> </x-playlist>
probably, have need completly change view of tracks. need give possibility change shadow dom into:
<x-playlist> <y-track name="track 1"></y-track> <y-track name="track 2"></y-track> <y-track name="track 3"></y-track> </x-playlist>
so. best way that?
you able define multiple possible selections insertion points. wanna like:
<template> <content select="x-track, y-track"></content> </template>
hope helps!
Comments
Post a Comment