Polymer 1.0 default icon set in iron-icons not working using blaze (meteor) templating engine

前端 未结 3 1645
暖寄归人
暖寄归人 2021-01-02 05:27

After upgrading to Polymer 1.0, default iron-icons set is not working. I am trying to use home icon from the default icon set.

HTML code fragment:

           


        
3条回答
  •  感情败类
    2021-01-02 05:52

    Got the real solution now (not workaround), therefore opened new answer.

    The cause of the warning in Chrome debugger is due to the wrong timing of loading the link imports in the right sequence.

    Solution:

    1.) Remove link imports in the iron-icons (and other icon-sets if needed, like maps, social, etc ...):

    • public
      • bower_components
        • iron-icons
          • iron-icons.html
          • maps-icons.html (optional, if you are using them)
          • social-icons.html (optional, if you are using them)

    iron-icons.html:

    before:

    
    
    
    
    
        
        
        
         etc ...) because it comes after that initial link-import (due to blocking nature of link import). Hence, at line 164 it cannot find the Default iconset icons, and therefore throwing the famous warning at line 167: 

    could not find iconset icons, did you import the iconset?

    2.) Load required dependencies in your project file in the correct sequence:

    
      
      
    
      
      
    
      
      
      
      
    
      
      
      
    
      
    
    

    The is loaded in last position now, hence all dependencies are available at this point.

    Works like a charm for me now.

    @LuckyRay's : Please let us know whether this works for you, too. I will post this on your github comment for the Polymer Team as well.

提交回复
热议问题