component.js 625 B

123456789101112131415161718
  1. import _ from 'lodash'
  2. import {baseConfigProcessList} from "../lib/config";
  3. export default function () {
  4. const ct = Ext.Component.prototype.constructor
  5. Ext.Component.override({
  6. constructor: function (config) {
  7. if(!window["IS_DESIGN_MODE"] && config) {
  8. const me = this
  9. // 任意组件 Ext.Component 构造时调用的方法, 可以用来在渲染之前加工处理 VJSON
  10. _.each(baseConfigProcessList, process => {
  11. process.call(me, me, config)
  12. })
  13. }
  14. ct.call(this, config)
  15. }
  16. });
  17. }