Open xuyingjie opened 9 years ago
ES7
Example:
var object = {}; Object.observe(object, function(changeRecords) { changeRecords.forEach(function(cr) { console.log(cr.name + ' ' + cr.type); }); }); object.p1 = 'Property 1'; object.p2 = 'Property 2'; object.p2 = 'Property II'; delete object.p1;
使用Object.observe实现简单的双向绑定: http://zhuanlan.zhihu.com/FrontendMagazine/20047033
ES7
Example: