// 这里方法重写基础行为,所有继承最基础的类 CancelAlert.prototype = new Alert()
CancelAlert.prototype.init = function () { TitleAlert.prototype.init.call(this) this.panel.appendChild(this.cancelBtn) }
CancelAlert.prototype.bindEvent = function () { var _this = this TitleAlert.prototype.bindEvent.call(_this) this.cancelBtn.onclick = function () { _this.fail() _this.hide() } }
// 使用 new CancelAlert({ title: 'dfasdfsdf', content: 'dsfsdfsdafs', success: function () { log('success') }, fail: function () { log('fail') } }).init()