1.0.3 • Published 10 years ago

understand v1.0.3

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

UnderStand.js

MV* framework you could understand in a moment

抽象模型:

  • 1.基类扩展
    understand.extend({
        fun1:function(){
            console.log('基类扩展)
        }
    });
    var Module = U.class();
    var i = new Module();
    i.fun1();
  • 2.创建模型
    U.extend({
        fun1:function(){
            console.log('func1 from base class');
        }
    })
    var Parent = U.class(function(name){
        console.log(name + ' born');
    });
    Parent.augment({
        fun2:function(){
            console.log('fun2 from method prototype');
        }
    });
    var Child = Parent.class(function(name){
        console.log(name + ' born');
        this.fun2();
    });
    Child.augment({
        fun3:function(){
            this.fun1();
           // this.fun2();
        }
    });
    var p = new Parent('parent');
    p.fun1();
    //p.fun2();
    var c = new Child('child');
    c.fun3();
  • 3.子类继承
  • 4.静态属性、方法

数据绑定:

   var Module = U.class();
  1. get
   Module.get(key);
  1. set
   Module.get(key, value);
  1. filter
   Module.filter(fn);
  1. delete
   Module.delete([key | fn]);
  1. all
   Module.all(); // return attributes
  1. size
   Module.size(); // return attributes size
  1. has
   Module.has(key);//return boolean
  1. update
   Module.update([key,]fn);

消息分发:

  1. on
  2. emit
  3. detach

通用工具类:

  1. each
  2. extend
  3. clone
  4. trim
  5. typeof
1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago