router
router copied to clipboard
建议调用bind函数时不要使用call
if (typeof route.bind === 'function'/* && !route.__isBind*/) {
route.bind.call(node);
//route.__isBind = true;
}
修改成
if (typeof route.bind === 'function'/* && !route.__isBind*/) {
route.bind(node);
//route.__isBind = true;
}
这样可以在bind函数中使用route对象,可以用来保存一些中间数据。