我的打字稿代码:
export class File {
isOpenEnabled() {
return false;
}
openClicked() {
debugger;
}
}
define([], function () {
return {
handler: new File()
};
});
变成:
define(["require", "exports"], function(require, exports) {
var File = (function () {
function File() {
}
File.prototype.isOpenEnabled = function () {
return false;
};
File.prototype.openClicked = function () {
debugger;
};
return File;
})();
exports.File = File;
define([], function () {
return {
handler: new File()
};
});
});
为什么要插入原型?
谢谢 - 戴夫