diff --git a/demo/js/addons/slider/demo.slider.js b/demo/js/addons/slider/demo.slider.js index 0a171b2817..1c53ab7741 100644 --- a/demo/js/addons/slider/demo.slider.js +++ b/demo/js/addons/slider/demo.slider.js @@ -2,16 +2,13 @@ * Created by Urthur on 2017/9/4. */ Demo.Slider = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(Demo.Slider.superclass._defaultConfig.apply(this, arguments), { - baseCls: "demo-slider", - min: 10, - max: 50 - }) + _props: { + baseCls: "demo-slider", + min: 10, + max: 50 }, - _init: function () { - Demo.Slider.superclass._init.apply(this, arguments); + render: function () { var singleSlider = BI.createWidget({ type: "bi.single_slider", digit: 0, @@ -92,7 +89,7 @@ Demo.Slider = BI.inherit(BI.Widget, { intervalSliderLabel.populate(); - BI.createWidget({ + return { type: "bi.vertical", element: this, items: [{ @@ -122,7 +119,7 @@ Demo.Slider = BI.inherit(BI.Widget, { }] }], vgap: 20 - }); + }; } }); BI.shortcut("demo.slider", Demo.Slider); \ No newline at end of file diff --git a/dist/demo.js b/dist/demo.js index bdf4b6132b..c9be435532 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -13,16 +13,13 @@ $(function () { * Created by Urthur on 2017/9/4. */ Demo.Slider = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(Demo.Slider.superclass._defaultConfig.apply(this, arguments), { - baseCls: "demo-slider", - min: 10, - max: 50 - }) + _props: { + baseCls: "demo-slider", + min: 10, + max: 50 }, - _init: function () { - Demo.Slider.superclass._init.apply(this, arguments); + render: function () { var singleSlider = BI.createWidget({ type: "bi.single_slider", digit: 0, @@ -103,7 +100,7 @@ Demo.Slider = BI.inherit(BI.Widget, { intervalSliderLabel.populate(); - BI.createWidget({ + return { type: "bi.vertical", element: this, items: [{ @@ -133,7 +130,7 @@ Demo.Slider = BI.inherit(BI.Widget, { }] }], vgap: 20 - }); + }; } }); BI.shortcut("demo.slider", Demo.Slider);Demo.Button = BI.inherit(BI.Widget, {