guy 7 years ago
parent
commit
8514120784
  1. 2
      Gruntfile.js
  2. 47
      demo/js/center.js
  3. 2
      src/core/ob.js

2
Gruntfile.js

@ -61,7 +61,7 @@ module.exports = function (grunt) {
},
demoJs: {
src: ['demo/version.js', 'demo/**/*.js'],
src: ['demo/version.js', 'demo/app.js', 'demo/js/**/*.js'],
dest: 'demo/dist/demo.js'
},
demoCss: {

47
demo/js/center.js

@ -2,11 +2,54 @@ Demo.Center = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
beforeCreate: function(){
beforeCreate: function () {
console.log("beforeCreate");
},
render: function () {
console.log("render");
return {
type: "bi.vertical",
hgap: 50,
vgap: 20,
items: [{
type: "bi.label",
text: "栅格布局",
height: 50
}, {
type: "bi.lattice",
columnSize: [0.1, 0.1, 0.3, 0.4, 0.1],
items: [{
type: "bi.label",
height: 30,
text: "Left-1",
cls: "layout-bg1 lattice-item",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Left-2",
cls: "layout-bg2 lattice-item",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Left-3",
cls: "layout-bg3 lattice-item",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Left-4",
cls: "layout-bg4 lattice-item",
hgap: 20
}, {
type: "bi.label",
height: 30,
text: "Left-5",
cls: "layout-bg5 lattice-item",
hgap: 20
}]
}]
}
},
created: function () {
console.log("created");

2
src/core/ob.js

@ -6,6 +6,7 @@
BI.OB = function (config) {
this.options = $.extend(this._defaultConfig(config), config);
this._init();
this._initRef();
};
$.extend(BI.OB.prototype, {
props: {},
@ -21,7 +22,6 @@ $.extend(BI.OB.prototype, {
_init: function () {
this._initListeners();
this._initRef();
this.init();
},

Loading…
Cancel
Save