【问题标题】:Meteor app launching issue while offline离线时流星应用程序启动问题
【发布时间】:2018-06-13 15:56:50
【问题描述】:

我有一个使用 Iron-router 的流星应用程序(带有 cordova)。它工作正常,但是当我尝试离线打开应用程序时,它会永远挂在加载屏幕上。连接到互联网时没有问题。

这是我的 config.js 文件的摘录:

this.Config = {
  name: 'MyApp',
  title: function() {
    return TAPi18n.__('configTitle');
  },
  subtitle: function() {
    return TAPi18n.__('configSubtitle');
  },
  logo: function() {
    return '<b>' + this.name + '</b>';
  },
  homeRoute: '/',
  publicRoutes: ['home']
};

这是我的 main.js 文件的样子:

Router.route('/', {
  name: 'home',
  layoutTemplate: 'homeLayout',
  onBeforeAction: function () { this.render();   }
});

注意:我已经找到了答案,但是因为我找了这么久,也许其他人会觉得这很有帮助

配置: 流星1.6 Iron-router 1.1.2

【问题讨论】:

    标签: cordova meteor startup offline iron-router


    【解决方案1】:

    这是答案:Iron-router 不喜欢 config.js 中的“/”路由定义

    所以只需将"/" 更改为"home" 即可!

    我使用Akshat的建议解决了这个问题

    【讨论】:

      猜你喜欢
      • 2012-05-29
      • 1970-01-01
      • 1970-01-01
      • 2014-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-10
      相关资源
      最近更新 更多