跳到主要内容

bind

Description​

在被调用时,将其 this 关键字设置为提供的值,从而返回一个新的函数

bind: (method: GanttCallback, thisArg: any) => GanttCallback

Parameters​

  • method - (必填) function - 目标函数
  • thisArg - (必填) object - 将作为绑定函数调用时传递给目标函数的 this 参数的值

Returns​

  • bound_function - (function) - 一个新函数,调用时会使用给定的 this 值来执行原始函数

Example​

gantt.bind(method, thisArg);

Details​

该方法用作 IE8 兼容的替代实现 Function.prototype.bind() 函数。

Change log​

  • 版本 4.0 中添加
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.