微信小程序 modal組件詳細(xì)介紹
modal彈出框常用在提示一些信息比如:退出應(yīng)用,清楚緩存,修改資料提交時(shí)一些提示等等。
常用屬性:
wxml
<!--監(jiān)聽(tīng)button點(diǎn)擊事件--> <button bindtap="listenerButton" type="primary">彈出modal</button> <!--彈出框--> <modal title="退出應(yīng)用" hidden="{{hiddenModal}}" confirm-text="再看看" cancel-text="退出" bindconfirm="listenerConfirm" bindcancel="listenerCancel" > 您是否真的要退出應(yīng)用 </modal>
js
Page({ data:{ // text:"這是一個(gè)頁(yè)面" hiddenModal: true }, listenerButton:function() { this.setData({ hiddenModal: !this.data.hiddenModal }) }, listenerConfirm:function() { this.setData({ hiddenModal: true }) }, listenerCancel:function() { this.setData({ hiddenModal: true }) }, onLoad:function(options){ // 頁(yè)面初始化 options為頁(yè)面跳轉(zhuǎn)所帶來(lái)的參數(shù) }, onReady:function(){ // 頁(yè)面渲染完成 }, onShow:function(){ // 頁(yè)面顯示 }, onHide:function(){ // 頁(yè)面隱藏 }, onUnload:function(){ // 頁(yè)面關(guān)閉 } })
相關(guān)文章:
hello WeApp icon組件
Window text組件 switch組件
tabBar底部導(dǎo)航 progress組件 action-sheet
應(yīng)用生命周期 button組件 modal組件
頁(yè)面生命周期 checkbox組件 toast組件
模塊化詳 form組件詳 loading 組件
數(shù)據(jù)綁定 input 組件 navigator 組件
View組件 picker組件 audio 組件
scroll-view組件 radio組件 video組件
swiper組件 slider組件 Image組件
相關(guān)文章
本地搭建微信小程序服務(wù)器的實(shí)現(xiàn)方法
這篇文章主要介紹了本地搭建微信小程序服務(wù)器的實(shí)現(xiàn)方法的相關(guān)資料,希望通過(guò)本文能幫助到大家,讓大家輕松的搭建自己的微信小程序的服務(wù)器,需要的朋友可以參考下2017-10-10Babel?插件開(kāi)發(fā)&訪問(wèn)節(jié)點(diǎn)實(shí)例詳解
這篇文章主要為答案及介紹了Babel?插件開(kāi)發(fā)&訪問(wèn)節(jié)點(diǎn)實(shí)例詳解,整理一下?Babel?插件開(kāi)發(fā)時(shí)用得到的轉(zhuǎn)換操作相關(guān)的?API,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-08-08JavaScript?CSS優(yōu)雅實(shí)現(xiàn)網(wǎng)頁(yè)多主題風(fēng)格換膚功能詳解
這篇文章主要為大家介紹了JavaScript?CSS優(yōu)雅的實(shí)現(xiàn)網(wǎng)頁(yè)多主題風(fēng)格換膚功能詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-02-02JavaScript數(shù)組對(duì)象高階函數(shù)reduce的妙用詳解
這篇文章主要為大家介紹了JavaScript數(shù)組對(duì)象高階函數(shù)reduce的妙用詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-04-04