Sometimes you may want to skip the Shadow DOM completely with Polymer.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can force your Polymer Element's template into the Light DOM by overriding parseDeclaration
on your Polymer()
JS/Coffeescript declaration.
Coffeescript Example:
Polymer "my-element",
parseDeclaration: (elementElement) ->
@lightFromTemplate(@fetchTemplate(elementElement))
Of course, you have to be careful because if you have anything that belongs in the Shadow DOM (like a stylesheet) in your template, it will now be in the Light DOM.
Edit: If there's a better way to do this, please let me know.