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