W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
半屏彈窗,輔助完成當(dāng)前頁面任務(wù)時;提醒用戶并引導(dǎo)用戶的下一步操作;用戶主動發(fā)起的任務(wù)時。
在 page.json 中引入組件
{
"usingComponents": {
"mp-halfScreenDialog": "../../components/half-screen-dialog/half-screen-dialog"
}
}
<!--WXML示例代碼-->
<mp-halfScreenDialog
bindbuttontap="buttontap"
show="{{show}}"
maskClosable="{{false}}"
title="測試標(biāo)題B"
subTitle="測試標(biāo)題B的副標(biāo)題"
desc="輔助描述內(nèi)容,可根據(jù)實際需要安排"
tips="輔助提示內(nèi)容,可根據(jù)實際需要安排"
buttons="{{buttons}}"
></mp-halfScreenDialog>
<button class="weui-btn" type="primary" bindtap="open">Open</button>
// page.js示例代碼
Page({
data: {
show: false,
buttons: [
{
type: 'default',
className: '',
text: '輔助操作',
value: 0
},
{
type: 'primary',
className: '',
text: '主操作',
value: 1
}
]
},
open: function () {
this.setData({
show: true
})
},
buttontap(e) {
console.log(e.detail)
}
});
屬性 | 類型 | 默認(rèn)值 | 說明 |
---|---|---|---|
extClass | string | 組件類名 | |
closabled | boolean | true | 是否展示關(guān)閉按鈕 |
title | string | 組件標(biāo)題,可通過slot自定義 | |
subTitle | string | 組件副標(biāo)題,可通過slot自定義 | |
desc | string | 輔助操作描述內(nèi)容 | |
tips | string | 輔助操作提示內(nèi)容 | |
maskClosable | boolean | true | 點擊遮罩是否關(guān)閉改組件 |
mask | boolean | true | 是否需要遮罩層 |
show | boolean | true | 是否開啟彈窗 |
buttons | array | [] | 輔助操作按鈕列表 |
事件名稱 | 說明 | 回調(diào)參數(shù) |
---|---|---|
buttontap | 點擊輔助操作按鈕時觸發(fā) | e.detail = { index, item } |
close | 組件關(guān)閉時候觸發(fā) |
名稱 | 描述 |
---|---|
title | 組件自定義標(biāo)題欄 |
desc | 組件自定義操作描述 |
footer | 操作按鈕區(qū)域slot |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: