我有代碼分割成不同的文件作爲例如(簡化版本):如何檢查父元素是否包含某個標籤? - 聚合物
管理員-page.html中
<paper-tabs selected={{selected}} attr-for-selecton="name">
<paper-tab name="User">User</paper-tab>
...
...
</paper-tabs>
<iron-pages selected={{selected}} attr-for-selection="name">
<admin-user-page name="User"></admin-user-page>
...
...
</iron-pages>
管理員用戶-page.html中
<!-- general page content... -->
// Javascript
//--------------
// here I want to have an if statement for whether the parent (user-page.html)
// contains the <paper-tabs> tag.
請記住,我是在對此進行PolymerJS解決方案之後,是否有任何方法檢測是否存在於admin-page.html from admin-user-page.html file?
你爲什麼想這樣做?難道你不能通過一個標誌或東西到你的管理用戶頁面組件?我覺得有點優雅 – dloeda
我幾乎不知道你的意思是什麼XD – physicsboy