-
JS通過匿名空間隔開公有私有查看全部
-
組件分類查看全部
-
瀏覽器底層 JS核心語法層薄弱 JS原生API不好用 瀏覽器兼容問題查看全部
-
獨(dú)立組件查看全部
-
通用組件和定制組件查看全部
-
不同層的職責(zé)和API查看全部
-
組件走走走查看全部
-
js實(shí)戰(zhàn)中四個(gè)分層的不同職責(zé)以及AP查看全部
-
看完整套課程,自己跟著敲的源碼,運(yùn)行成功有(alert,confirm,prompt,common)https://github.com/Jessicatt/require_component.git查看全部
-
阻塞vs回調(diào):查看全部
-
Widget類設(shè)計(jì)統(tǒng)一的生命周期: box:外層容器 on: fire: renderUI:添加dom節(jié)點(diǎn) bindUI:監(jiān)聽事件 asyncUI初始化組件屬性 render:function(container){ //渲染組件 this.renderUI(); this.handlers={}; this.bindUI(); this.syncUI(); $(container||document.body).append(this.box); destructor:function(){},//銷毀前處理函數(shù) destroy:function(){ this.destructor(); this.box.off(); this.box.remove(); } }查看全部
-
Widget類:js所有類繼承自O(shè)bject,提供的幫助太少。 組件分utility和Widget兩類,utility和UI無關(guān),Widget和UI有關(guān) 繼承:window.prototype = $.extend({},new Widget.widget(),{ alert:funciton(cfg){ } })查看全部
-
連綴語法:增加 return this;查看全部
-
on:function(type,handler){ if(typeof this.handlers[type]=='undefined') this.handlers[type]=[]; this.handlers[type].push(handler); } fire:function(type,data){ if(this.handlers[type] instanceof Array){ var handlers = this.handlers[type]; for(var i=0,len = handlers.length;i<len;i++){ handlers[i][data] } } }查看全部
-
自定義事件: 本質(zhì):觀察者模式 優(yōu)點(diǎn):跳出原生事件的限制,提高封裝的抽象層級(jí)查看全部
舉報(bào)
0/150
提交
取消