Polymer 相对资源路径的解析路径

Polymer 相对资源路径的解析路径,polymer,Polymer,我试图解决硫化聚合物应用程序中的资源加载错误。我已经阅读了有关方法resolvePath的文档,但这似乎无法解决问题。这是我的项目结构: test ├── assets │   └── avatar.png ├── components │   └── custom-elem-with-relative-path-to-avatar.html └── index.html custom-elem-with-relative-path-to-avatar.html 您应该使用 this.reso

我试图解决硫化聚合物应用程序中的资源加载错误。我已经阅读了有关方法
resolvePath
的文档,但这似乎无法解决问题。这是我的项目结构:

test
├── assets
│   └── avatar.png
├── components
│   └── custom-elem-with-relative-path-to-avatar.html
└── index.html
custom-elem-with-relative-path-to-avatar.html

您应该使用

this.resolvePath('./assets/avatar.png')
聚合物0.5或

this.resolveUrl('./assets/avatar.png')
在聚合物1.0中

this.resolveUrl('./assets/avatar.png')