Web Components, pass data to and from

前端 未结 4 1968
傲寒
傲寒 2020-12-23 20:35

My understanding is that data is passed to a custom html element via its attributes and sent out by dispatching a CustomEvent.

JavaScript objects can obviously be s

4条回答
  •  甜味超标
    2020-12-23 21:20

    Using a tiny lib such as Lego would allow you to write the following:

    
    

    and within your my-element.html web-component:

    
    

提交回复
热议问题