1
我在我的Marionette ItemView中聲明瞭多個模板,當我渲染我的ItemView時,我說我想使用哪個模板。如何檢查在Marionette中使用哪個模板ItemView
templates: {
'images': ImageResultTmpl,
'music': MediaResultTmpl,
'videos': MediaResultTmpl
},
在ItemView中的方法裏面可以獲得活動模板的名稱?
if(music){
do this;
}
else{
do that;
}
如何確定在渲染時使用哪個模板? – ne8il