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
Templates 在ViewModel绑定中设置Meteor动态模板名称_Templates_Meteor_Viewmodel - Fatal编程技术网

Templates 在ViewModel绑定中设置Meteor动态模板名称

Templates 在ViewModel绑定中设置Meteor动态模板名称,templates,meteor,viewmodel,Templates,Meteor,Viewmodel,我有以下模板,它使用Tempalte.dynamic helper来渲染动态模板 <template name="links"> <div class="panel-body"> {{> Template.dynamic template=viewTypeTemplate data=links}} </div> </template> 但它不适用于用户Meteor V

我有以下模板,它使用Tempalte.dynamic helper来渲染动态模板

    <template name="links">
          <div class="panel-body">
            {{> Template.dynamic template=viewTypeTemplate data=links}}
        </div>
   </template>
但它不适用于用户Meteor Viewmodel绑定变量而不是模板辅助变量

Template.links.viewmodel({
    isThumbView: false,
    viewTypeTemplate: function(){
      return this.isThumbView()? 'linkThumbList' : 'linkList';
   }
});
公开
viewTypeTemplate
作为帮助程序公开使用。 适用于多个助手

Template.links.viewmodel({
        isThumbView: false,
        viewTypeTemplate: function(){
          return this.isThumbView()? 'linkThumbList' : 'linkList';
       }
},['viewTypeTemplate','isThumbView']);
更多信息请访问

Template.links.viewmodel({
    isThumbView: false,
    viewTypeTemplate: function(){
      return this.isThumbView()? 'linkThumbList' : 'linkList';
   }
},'viewTypeTemplate');
Template.links.viewmodel({
        isThumbView: false,
        viewTypeTemplate: function(){
          return this.isThumbView()? 'linkThumbList' : 'linkList';
       }
},['viewTypeTemplate','isThumbView']);