Polymer 聚合物起动器套件布线问题
我正在使用polymer starter kit代码,并获得带有主页、联系人和用户菜单的GUI。我正在eclipse中使用Java动态Web项目。因此,基本url是:Polymer 聚合物起动器套件布线问题,polymer,web-component,Polymer,Web Component,我正在使用polymer starter kit代码,并获得带有主页、联系人和用户菜单的GUI。我正在eclipse中使用Java动态Web项目。因此,基本url是: localhost:8080/TestProject/ 当我单击“联系人”或“用户”菜单后单击“主页”时,它会将url更改为: localhost:8080 我已尝试将app.js文件中的默认基本url设置为: app.baseUrl='/TestProject/' 但行为还是一样的 如果在routing.html中,
localhost:8080/TestProject/
当我单击“联系人”或“用户”菜单后单击“主页”时,它会将url更改为:localhost:8080
app.baseUrl='/TestProject/'代码>
但行为还是一样的
<paper-menu class="app-menu" attr-for-selected="data-route" selected="[[route]]">
<a data-route="home" href="{{baseUrl}}TestProject">
<iron-icon icon="home"></iron-icon>
<span>Home</span>
</a>
但它应该是:
http://localhost:8080/TestProject/
或
伙计们,我哪里做错了。或者我应该在哪里进行更改以实现主url。
非常感谢。较新版本的PSK在
router.html
中有以下部分:
// Removes end / from app.baseUrl which page.base requires for production
if (window.location.port === '') { // if production
page.base(app.baseUrl.replace(/\/$/, ''));
}
page('/',updateRedux, function() {
page.redirect('/start');
});
page(app.baseUrl,updateRedux, function() {
page.redirect('/start');
});
尝试删除主路径开头的
/
http://localhost:8080/TestProject/
http://localhost:8080/TestProject/#!/home
// Removes end / from app.baseUrl which page.base requires for production
if (window.location.port === '') { // if production
page.base(app.baseUrl.replace(/\/$/, ''));
}
page('/',updateRedux, function() {
page.redirect('/start');
});
page(app.baseUrl,updateRedux, function() {
page.redirect('/start');
});