写成模板,让之跟着写。。
比如sina的,大概是。
in closure ... {
let initVar = func(){}
let initView = func(){}
xxx
xxx
xxxx
var init = func(){
init variables,
init view,
bind domEvent
bind notifyEvent
bind customEvent
}
init();
return object ...
}
【 在 zeus2615 (zeuslord·呆猫) 的大作中提到: 】
: 我觉得非常好!
: 我现在公司的前端除了写html和css还写部分js,但是写出来的js经常让我觉得很无语,高耦合,到业务js的时候根本没法调
--
FROM 123.116.145.63