微信小程序-弹框插件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 下载
git clone git@github.com:konggeyuan/popup.git

//json文件定义
"usingComponents": {
"zx-popup": "/components/zx-popup/index"
}

//页面
<button bindtap="bottomPop">显示bottom弹框</button>

//弹框界面
<zx-popup popup-visible="{{ bottom }}" zx-position="{{'bottom'}}" bind:popupStatus="popupChange">
<view class="wrap bottom">显示bottom弹框</view>
</zx-popup>

//调用
bottomPop() {
this.setData({
bottom: true
});
},

//状态events
popupChange() {
console.log(this.data.bottom);
},