我的代码
scores() {
let that = this;
this.redoCount = 0;
this.undoCount = 0;
this.datasourceList = [];
this.createDatePicker();
$("#optPlayerDetaileditor").kendoEditor({
tools: ["bold", "italic", "underline"],
change: function () {
that.sportsPlayer.sportsPlayerDetailsText = this.value();
let eventData = { "eventKey": "optPlayerDetaileditor", "sourceValue": that.sportsPlayerDetailSource, "destinationValue": that.sportsPlayer.sportsPlayerDetailsText, "type": "generateBtn" }
that.eventCapture(eventData);
that.sportsPlayerDetailSource = that.sportsPlayer.sportsPlayerDetailsText;
that.saveBtnEnableDisable();
}, encoded: true,
serialization: {
semantic: false,
entities: false,
custom: function (html) {
return html.replace(/<b>/g, "<B>").replace(/<\/b>/g, "</B>").replace(/<i>/g, "<I>").replace(/<\/i>/g, "</I>").replace(/<u>/g, "<U>")
.replace(/<\/u>/g, "</U>").replace(/<br \/>/g, "\n").replace(/ /g, " ").replace(/&/g, "&").replace(/"/g, '"').replace(/>/g, ">")
.replace(/</g, "<").replace(/·/g, ".").replace(/ /g, " ");
}
},
}).text();
}zone.js
ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {
try {
return this._invokeTaskZS
? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this.zone, targetZone, task, applyThis, applyArgs)
: task.callback.apply(applyThis, applyArgs);
}发布于 2018-05-15 07:11:14
不知道你说的黑拳击Zone.js是什么意思。但是调用task.callback.apply(applyThis, applyArgs)方法来调用任何计划的任务。
如果您执行window.setTimeout(cb,1000);,这实际上将调用猴补丁API而不是window.setTimeout。在该API中,一个新的Task对象是已创建,其属性callback由传递给setTimeout方法的cb初始化。此外,cb被另一个名为计时函数的回调所取代。现在,当时间到期时,JS将调用Zone.js的回调方法,即timer,它最终将调用task.callback.apply(applyThis, applyArgs)。
有关如何使用Zone.js猴子补丁程序接口的详细信息,请参阅下面的文章。
https://stackoverflow.com/questions/48039391
复制相似问题