Blend UI Footbar API文檔

2018-10-17 11:35 更新

Construct

配置所需參數(shù)來初始化一個底部菜單組件Footbar

Footbar的配置格式如下:

var footbar = new Blend.ui.Footbar({"options":"values"});

Slider包含以下配置項:


id

footbar的id

類型說明是否必須
Stringfootbar的id


實例:

var footbarCase = new Blend.ui.Footbar({
    "id": "footbartest",
    "menus": [
        {id:0,name:"賬單",subMenus:[
            {id:100,name:"當月賬單"},
            {id:101,name:"歷史賬單"}
        ]
        },
        {id:1,name:"我的"}
     ]
});


top

配置footbar距離屏幕top的坐標

類型說明是否必須
Numberfootbar距離屏幕top的坐標,默認值在頁面底部


實例:

var footbarCase = new Blend.ui.Footbar({
    "id": "footbarCase",
    "top": 100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


left

配置footbar距離屏幕left的坐標

類型說明是否必須
Number距離屏幕left的坐標,默認值0


實例:

var footbarCase = new Blend.ui.Footbar({
    "id": "footbarCase",
    "top": 100,
    "left":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


width

配置footbar寬度

類型說明是否必須
Numberfootbar像素寬度,默認為屏幕寬度


實例:


var footbarCase = new Blend.ui.Footbar({
    "id": "footbarCase",
    "top": 100,
    "left":100,
    "widht":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


height

配置footbar高度

類型說明是否必須
Number菜單高度,默認45px


實例:


var footbarCase = new Blend.ui.Footbar({
    "id": "footbarCase",
    "top": 100,
    "left":100,
    "widht":100,
    "height":100,
    "menus": [
        {id:0,name:"賬單"},
        {id:1,name:"我的"}
     ]
});


selected

菜單被選中時的觸發(fā)函數(shù)

類型說明是否必須
Function點擊菜單觸發(fā);默認為空;


實例:


footbarCase = new Blend.ui.Footbar({
    id:"footbartest",
    menus:[
        {id:0,name:"賬單",
            subMenus:[{id:100,name:"當月賬單"},{id:101,name:"歷史賬單"}]},
        {id:1,name:"我的",
            subMenus:[{id:100,name:"積分"},{id:101,name:"額度"},{id:102,name:"開卡"},{id:103,name:"繳費"},{id:104,name:"預(yù)約"}]},
        {id:2,name:"自助查詢"},
        {id:3,name:"資訊",
            subMenus:[{id:101,name:"今日頭條"},{id:102,name:"昨日頭條"},{id:103,name:"前日頭條"},{id:104,name:"大前日頭條"}]}
    ],
    selected:function(e){
        alert(JSON.stringify(e.data));
    }
});


Method

show ( )

把footbar顯示


實例:


var footbarCase = new Footbar({
    id:"footbartest",
    menus:[
        {id:0,name:"賬單",
            subMenus:[{id:100,name:"當月賬單"},{id:101,name:"歷史賬單"}]},
        {id:1,name:"我的",
            subMenus:[{id:100,name:"積分"},{id:101,name:"額度"},{id:102,name:"開卡"},{id:103,name:"繳費"},{id:104,name:"預(yù)約"}]},
        {id:2,name:"自助查詢"},
        {id:3,name:"資訊",
            subMenus:[{id:101,name:"今日頭條"},{id:102,name:"昨日頭條"},{id:103,name:"前日頭條"},{id:104,name:"大前日頭條"}]}
    ],
    selected:function(e){
        alert(JSON.stringify(e.data));
    }
});
footbarCase.show();


hide ( )

隱藏footbar菜單


實例:


var footbarCase = new Footbar({
    id:"footbartest",
    menus:[
        {id:0,name:"賬單",
            subMenus:[{id:100,name:"當月賬單"},{id:101,name:"歷史賬單"}]},
        {id:1,name:"我的",
            subMenus:[{id:100,name:"積分"},{id:101,name:"額度"},{id:102,name:"開卡"},{id:103,name:"繳費"},{id:104,name:"預(yù)約"}]},
        {id:2,name:"自助查詢"},
        {id:3,name:"資訊",
            subMenus:[{id:101,name:"今日頭條"},{id:102,name:"昨日頭條"},{id:103,name:"前日頭條"},{id:104,name:"大前日頭條"}]}
    ],
    selected:function(e){
        alert(JSON.stringify(e.data));
    }
});
footbarCase.hide();


destroy ( )

銷毀footbar


實例:


var footbarCase = new Footbar({
    id:"footbartest",
    menus:[
        {id:0,name:"賬單",
            subMenus:[{id:100,name:"當月賬單"},{id:101,name:"歷史賬單"}]},
        {id:1,name:"我的",
            subMenus:[{id:100,name:"積分"},{id:101,name:"額度"},{id:102,name:"開卡"},{id:103,name:"繳費"},{id:104,name:"預(yù)約"}]},
        {id:2,name:"自助查詢"},
        {id:3,name:"資訊",
            subMenus:[{id:101,name:"今日頭條"},{id:102,name:"昨日頭條"},{id:103,name:"前日頭條"},{id:104,name:"大前日頭條"}]}
    ],
    selected:function(e){
        alert(JSON.stringify(e.data));
    }
});
footbarCase.destroy();
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號