relative path resources from JS with HTML imports

后端 未结 2 710
春和景丽
春和景丽 2021-01-15 14:17

I\'ve got a (Polymer) web component that I want to make accessible to people in a cross-origin resource sharing (CORS) fashion. That works fine except I\'m not sure how I c

2条回答
  •  长发绾君心
    2021-01-15 14:56

    To create relative paths you can use the resolvePath method of your Polymer element. Here's the docs on it

    ex: this.resolvePath('x-foo.png')

    Update: resolvePath is replaced with resolveUrl for Polymer 1.0

提交回复
热议问题