How to find out what element is going to be extended, while registering my own in Polymer

你说的曾经没有我的故事 提交于 2019-12-11 06:17:14

问题


I recently asked How to extend multiple elements with Polymer and it turned out, in fact, you can't really. The idea was to create a web component that can be applied to different elements to "decorate" them.

Addy Osmani answered this question with a few approaches to handle that use case.

One of them was:

The alternative (if you strictly want to do this all in one custom element, which imo, makes this less clean) is to do something like checking against the type of element being extended, which could either be done in the manner you linked to or by checking as part of your element registration process.

Despite from fact that this approach might be less clean, my question is:

How I can find out what element is going to be extended while I'm registering my own?

来源:https://stackoverflow.com/questions/24179075/how-to-find-out-what-element-is-going-to-be-extended-while-registering-my-own-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!