我正在构建一个基于filesytem的emberjs-app。但不幸的是,安全性不允许我将内容推送到历史记录中(例如this,但我想这适用于所有浏览器)。
将locationtype设置为none很好,但我还是想使用浏览器的后退和前进按钮和网址。
有没有办法配置它(可能将base-url设置为index.html,而不重写构建过程)?
修改
我从我的浏览器中调用这样的url:file:///path/index.html。
在我的routes.js和fileroute.js中我有这个解决方法:
// routes.js
export default Router.map(function() {
// this route only redirects to main
this.route('fileroute', {path: 'index.html'});
});
// routes/fileroute.js
// only for running app on filesystem
export default Ember.Route.extend({
redirect: function() {
this.transitionTo('fileroute.projects');
}
});
所以我猜每个哈希变化都会影响files-url
file:///path/#differentroute
also for
file:///path/#index.html/childRoute