JS中装饰器模式的实现

var tree = {}; tree.decorate = function() { alert('Make sure the tree won\'t fall'); }; tree.getDecorator = function(deco){ tree[deco].prototype = this; return new tree[deco]; }; tree.RedBalls = funct
相关文章
相关标签/搜索