简体   繁体   English

Marionette CollectionViews 有 templateContext 吗?

[英]Do Marionette CollectionViews have a templateContext?

I can provide a templateContext to other Marionette views, but the CollectionView does not seem to take advantage of it when provided.我可以为其他 Marionette 视图提供一个 templateContext,但 CollectionView 在提供时似乎没有利用它。 Do Marionette CollectionViews have a templateContext? Marionette CollectionViews 有 templateContext 吗?

Yes, CollectionViews use the templateContext parameter.是的,CollectionViews 使用 templateContext 参数。 However, CollectionViews do NOT respect the renderer specified by Marionette.View.setRenderer.但是,CollectionViews 不尊重 Marionette.View.setRenderer 指定的渲染器。 So, if one specifies a "global" renderer - in my case to use Mustache:所以,如果一个人指定一个“全局”渲染器——在我的例子中使用 Mustache:

Marionette.View.setRenderer((template, viewToRender) => {
    return Mustache.render(template, viewToRender);
});

the templateContext is essentially ignored. templateContext 基本上被忽略了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM