Is it possible to share mixins across web components (and imports) in Polymer?

前端 未结 2 700
梦谈多话
梦谈多话 2021-02-06 03:32

As a follow up to How to extend multiple elements with Polymer and Polymer multiple inheritence/composition, based on their answers, I wonder if it\'s possible to share mixins a

2条回答
  •  故里飘歌
    2021-02-06 04:12

    To use a global-like component is the recommended way to go.
    make a and use get/set to change it (also you can use attributes although they are only sad strings).

    from Polymer API guide you'll see working (good looking) examples like this:

     
      
    
    

    And play with them using javascript es5 getters/setters such as in the above mentioned case would look like

     
      
    
    

    I'll be back.

提交回复
热议问题