0
是否有可能在Sproutcore中定制html/javascript?我不得不使用云服务提供者的一些代码。Sproutcore中的自定义html/javascript?
是否有可能在Sproutcore中定制html/javascript?我不得不使用云服务提供者的一些代码。Sproutcore中的自定义html/javascript?
是的,这很容易。在你看来,你可以定义一个render()
方法:
App.myView = SC.View.extend({
render: function(context, firstTime) {
var someValue = `getValue`
context.push(
"<span class='mySpan'>", someValue, "</span>",
"Any Other html/javascript that you want, can go here."
);
}
})
您还可以使用firstTime
属性知道,如果你正在呈现第一次(放出来的一切),或者只是更新现有的代码。
你可以找到更多: