0

我们正在尝试Ext.mixin.Observable在我们的 ViewController 中实现,下面的代码片段

mixins: ['Ext.mixin.Observable'],
constructor: function(config){
  this.mixins.observable.constructor.call(this, config);
},

但这会this.mixins.observable.constructor.call(this, config);在 Viewcontroller 中引发错误

BaseController.js?_dc=1587282588103:440 Uncaught TypeError: Cannot read property 'listen' of undefined
    at constructor.listen (BaseController.js?_dc=1587282588103:440)
    at constructor.callParent (Base.js?_dc=1587282588090:1479)
    at constructor.listen (ViewController.js?_dc=1587282588091:206)
    at constructor.updateListen (BaseController.js?_dc=1587282588103:257)
    at constructor.setter [as setListen] (Config.js?_dc=1587282588102:329)
    at Ext.Configurator.configure (Configurator.js?_dc=1587282588102:674)
    at constructor.initConfig (Base.js?_dc=1587282588090:1650)
    at constructor (Observable.js?_dc=1587282588091:437)
    at constructor (MainController.js?_dc=1587282588090:6)

这里可能有什么问题,我遵循了 sencha docs 上给出的文档Ext.mixin.Observable

4

1 回答 1

0

看起来你this.callParent(arguments)在调用 observable 构造函数后错过了构造函数

于 2020-04-20T09:43:28.937 回答