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
Jquery mobile Jquery mobile和meteor反应模板变量不工作_Jquery Mobile_Meteor - Fatal编程技术网

Jquery mobile Jquery mobile和meteor反应模板变量不工作

Jquery mobile Jquery mobile和meteor反应模板变量不工作,jquery-mobile,meteor,Jquery Mobile,Meteor,当我有一个模板变量,并且我改变了它,屏幕就会变白,变成空白 下面是一个简单的例子: {{#if var}} <p align="center">reactive templating</p> <button id="button" value="click"/> {{else}} <p align="center">worked!</p> {{/if}} Session.setDefault("var",true); T

当我有一个模板变量,并且我改变了它,屏幕就会变白,变成空白

下面是一个简单的例子:

{{#if var}}
<p align="center">reactive templating</p>
<button id="button" value="click"/>
{{else}}
<p align="center">worked!</p>
{{/if}} 




Session.setDefault("var",true);

  Template.content.var = function () {
    return Session.get("var");
  }

  Template.content.events({
    'click #button': function(e,t) {
      Session.set("var", false);
    }
  });
{{#if var}
反应性模板

{{else}

工作正常

{{/if} setDefault(“var”,true); Template.content.var=函数(){ return Session.get(“var”); } Template.content.events({ “点击按钮”:函数(e,t){ Session.set(“var”,false); } });
问题是我

<body>
{{>content}}
</body>

{{>内容}}
因此,它重新呈现整个页面,包括页面div

因此,请改为这样做

<body>
<div data-role="page">
{{>content}}
</div>
</body>

{{>内容}