0
我建立了自己的拳頭sproutcore應用程序。現在resource/mainpage中的代碼變大了。我想 重構代碼,所以視圖都在它們自己的獨立文件中。sproutcore主頁重構
如何做到這一點?
示例代碼
Tp.mainPage = SC.Page.design({
mainPane: SC.MainPane.design({
childViews: [SC.TabView.design({
value: "welcome",
items: [
{ title: "Welcome", value: "welcome"},
{ title: "route", value: "Tp.mainPage.contentview"},
{ title: "manifold", value: "manifold"},
],
itemTitleKey: 'title',
itemValueKey: 'value',
layout: { left:12, right:12, top:12, bottom:12},
userDefaultKey: "mainPane",
})]
}),
welcome: SC.LabelView.design({ ..some code }),
contentview: SC.SplitView.design({
..mucho code... }),
manifold: SC.View.extend({
..mucho code... }),
我想重構出MUCHO部分代碼。
日Thnx原來如此! – Stephan 2011-06-16 16:19:44