luoyifan 4 năm trước cách đây
mục cha
commit
1852c9bdb3
2 tập tin đã thay đổi với 19 bổ sung14 xóa
  1. 2 0
      src/Defaults.ts
  2. 17 14
      src/controls/toolbar/toolbar.js

+ 2 - 0
src/Defaults.ts

@@ -15,6 +15,8 @@ export const text = {
     labelWidth: 70,
 }
 
+export const toolbar = {}
+
 export const maintab = {}
 
 export const rows = {}

+ 17 - 14
src/controls/toolbar/toolbar.js

@@ -2,20 +2,23 @@ import _ from 'lodash'
 import $ from 'jquery'
 import initTbFill from './tbfill'
 import initTbSeparator from './tbseparator'
+import {baseConfig} from "../base";
+import {toolbar} from "../../Defaults";
 
 export default function () {
-  /**
-   *
-   */
-  const ct = Ext.toolbar.Toolbar.prototype.constructor
-  Ext.toolbar.Toolbar.override({
-    constructor: function (config) {
-      const newConfig = _.defaultsDeep({}, config, {
-        cls: ['yvan_design', 'design_cols_container']
-      })
-      ct.call(this, newConfig)
-    }
-  });
-  initTbFill();
-  initTbSeparator();
+    /**
+     *
+     */
+    const ct = Ext.toolbar.Toolbar.prototype.constructor
+    Ext.toolbar.Toolbar.override({
+        constructor: function (config) {
+            const newConfig = _.defaultsDeep({
+                // 强制性属性
+            }, baseConfig(config, 'row-item'), config, toolbar)
+
+            ct.call(this, newConfig)
+        }
+    });
+    initTbFill();
+    initTbSeparator();
 }