我正在使用 ractivejs 在服务器和客户端上呈现 html。我希望有一个索引页面作为 ractivejs 实例,其中可以根据变量名称呈现页面模板,例如:
this.ractive = new Ractive({
template: _GLOBAL.templates.index,
partials: _GLOBAL.templates,
data: {
context: context,
getPage: function () {
/** Should return rendered partial, or something that will end up as {{> myPartialName}} in index */
return '> home';
}
}
})
ractivejs 目前可以吗?