2016-08-02 3 views
0

중첩 된 구성 요소를 조회하려면 다음 나는 세 번째 구성 요소를 선택 쿼리 어떻게폴리머 - 어떻게 구성 요소가 같은 중첩 된

<first-component> 
 
    <second-component> 
 
     <third-component></third-component> 
 
    </second-component> 
 
</first-component>

를?

Chrome에서 document.querySelector ('third-component')는 작동하지만 Firefox에서는 작동하지 않습니다. 당신이 폴리머의 정의에있는 경우

감사들 :

+0

Firefox에서 정확히 어떻게됩니까? –

+0

Firefox에서 중첩 된 구성 요소를 쿼리하려고하면 null이라는 콘솔 오류가 있습니다. 찾을 수 없기 때문에 생각합니다. – Richard

답변

0

, 당신은 this.$$(third-component)를 사용할 수 있습니다.

그렇지 않으면 태그에 id을 설정해야합니다. 그런 다음 Polymer를 사용하는 경우 document.querySelector('#id') 또는 this.$.id을 사용할 수 있습니다.

+0

그리고 Firefox에서'querySelector'가 작동하지 않는 이유는 무엇입니까? –

관련 문제