如何在聚合物2.0中获得基本元素?

时间:2017-06-21 12:35:09

标签: polymer-1.0 polymer-2.x

我目前正在研究Polymer 2.0。 以前我用的是1.7.0。在那里我们使用domHost或dataHost来获取基本元素。 像这样 -

<iframe frameborder="0" width="359" height="200" src="//www.dailymotion.com/embed/video/x5b4cfz" allowfullscreen></iframe>

但是在聚合物2.0中,它不起作用。 对此有任何建议。

更新

我的元素流是这样的想法 -

search-element - &gt; card-element - &gt;形元件

这是form-element的一个属性,它从index -

调用label
 this.domHost.querySelector("#paperCard");

1 个答案:

答案 0 :(得分:0)

你可以使用 <android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:tabIndicatorColor="@android:color/white" app:tabGravity="fill" app:tabMode="fixed" />

但即使是“更好”也可能 this.shadowRoot.querySelector('#paperCard')

这个。$允许你选择你的影子dom元素,如果它有一个id。

相关问题