Javascript 基于文件系统的应用程序
我正在构建一个基于文件系统的emberjs应用程序。但不幸的是,安全性不允许我将内容推送到历史记录中(例如,请参阅,但我想这适用于所有浏览器) 将locationtype设置为none很好,但我仍然希望利用浏览器的后退和前进按钮以及URL 有没有一种方法可以配置它(可以将基本url设置为index.html,而不重写构建过程) 编辑 我从浏览器中调用url,如下所示:file:///path/index.html. 在我的routes.js和fileroute.js中,我有以下解决方法:Javascript 基于文件系统的应用程序,javascript,ember.js,Javascript,Ember.js,我正在构建一个基于文件系统的emberjs应用程序。但不幸的是,安全性不允许我将内容推送到历史记录中(例如,请参阅,但我想这适用于所有浏览器) 将locationtype设置为none很好,但我仍然希望利用浏览器的后退和前进按钮以及URL 有没有一种方法可以配置它(可以将基本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');
}
});
所以我猜每一个散列更改都会影响文件的url
file:///path/#differentroute
also for
file:///path/#index.html/childRoute
您应该仍然能够在文件系统上使用哈希路由?是的,但我想这是ember处理基本url的方式(我在上面添加了一些注释)