简体   繁体   English

在Dart Polymer中如何定义嵌套的自定义元素?

[英]In dart polymer how to define nested custom element?

I want to build a library for custom elements with Dart Polymer, the architecture looks like this: 我想使用Dart Polymer构建自定义元素的库,该体系结构如下所示:

<parent-custom-element attributes="xxxx">
<child-custom-element-0 attributes="yyyyy">     </child-custom-element-0>
<child-custom-element-1 attributes="zzzzzzzz">     </child-custom-element-1>
</parent-custom-element>

The requirement is that: the child-custom-element could access the DOM/variables/object of the parent-custom-element. 要求是:子级自定义元素可以访问父级自定义元素的DOM /变量/对象。 For example, if the parent-custom-element has a canvas object, the child-custom-element could draw line, or circle on it. 例如,如果父自定义元素具有画布对象,则子自定义元素可以在其上画线或画圆。

Any ideas how to do it? 有什么想法怎么做? Or any examples to guide me? 或任何指导我的例子?

Thanks! 谢谢!

I wrote a blog post about nesting polymer elements: 我写了一篇关于嵌套聚合物元素的博客文章:

http://www.roberthartung.de/nested-polymer-elements-and-data-binding-in-googles-dart/ http://www.roberthartung.de/nested-polymer-elements-and-data-binding-in-googles-dart/

This should help you to understand how to nest elements. 这应该可以帮助您了解如何嵌套元素。 Feel free to ask further questions! 随时提出其他问题!

Regards Robert 问候罗伯特

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM