Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor-如何在加载模板时正确显示微调器_Meteor - Fatal编程技术网

Meteor-如何在加载模板时正确显示微调器

Meteor-如何在加载模板时正确显示微调器,meteor,Meteor,我有一个模板,它有一个故意延迟使用,所以我可以测试一个缓慢的服务器 <template name="aboutPage"> <img src="http://deelay.me/2000/http://i.telegraph.co.uk/multimedia/archive/02830/cat_2830677b.jpg"> </template> 加载模板: <template name="loading"> {{> spinner

我有一个模板,它有一个故意延迟使用,所以我可以测试一个缓慢的服务器

<template name="aboutPage">
  <img src="http://deelay.me/2000/http://i.telegraph.co.uk/multimedia/archive/02830/cat_2830677b.jpg">
</template>
加载模板:

<template name="loading">
  {{> spinner}}
</template>

{{>微调器}

出于某种原因,当我点击About页面时,我会在加载图像时看到一个丢失的图像图标。我遗漏了什么吗?

我建议你检查一下这个包裹: 它可以让你延迟在快速路线上出现的进度

Router.configure
    progressDelay : 100
关于“丢失的图像图标”,我试图重现这种情况,但我做不到。但是,我注意到使用deelay.me技术无法测试路由之间的负载。这是因为图像请求启动时,aboutPage已经加载。因此,加载微调器已经消失

检查此报告,这是一个实际跟踪图像加载的简单示例:


我希望这能有所帮助:)

我让它与此一起工作

Router.route('/about', {
  name: 'about',
  data: function() { 

    if(this.ready()){
      this.render()
    }else{
      this.render('loading')
    }
  }
});
看一看,这里我们确保模板上的所有数据都准备好了,否则我们将呈现
“加载”
模板


这对我有用

这个还能用吗?我的微调器仅在使用waitOn:function()时显示,并在内容完全加载之前消失(可能是因为我在localhost上)。问题是我有静态模板,我没有任何订阅。建议?
Router.route('/about', {
  name: 'about',
  data: function() { 

    if(this.ready()){
      this.render()
    }else{
      this.render('loading')
    }
  }
});