Polymer 应用程序路由器路径抛出错误中的尾部斜杠(聚合物)

Polymer 应用程序路由器路径抛出错误中的尾部斜杠(聚合物),polymer,web-component,Polymer,Web Component,我的应用程序路由器设置如下: <app-router id="router" mode="pushstate"> <app-route path="/:category" import="bower_components/my-elements/category-page.html"></app-route> <app-route path="/product/:query" import="bower_components/my-elements/pr

我的应用程序路由器设置如下:

<app-router id="router" mode="pushstate">
<app-route path="/:category" import="bower_components/my-elements/category-page.html"></app-route>
<app-route path="/product/:query" import="bower_components/my-elements/product-page.html"></app-route>
</app-router>

导航到我的分类页面效果很好。如果我将URL中的路径更改为不同的类别,则内容会相应地更新


然而,当尝试加载产品页面时,我的应用程序陷入无限循环。控制台打印了一个带有意外标记“的
uncaught语法错误,我也遇到了同样的问题,我刚刚发现这是由于相对路径造成的。如果将模板中的导入(以及应用程序路由导入)更改为绝对路径,则应该可以解决问题。

将相对路径更改为绝对路径可以解决问题。非常感谢你的帮助。