微信小程序自定义弹框组件
效果图: <!--components/popup/popup.wxml--> <view class="popup" hidden="{{flag}}"> <view class='popup-container'> <view wx:if="{{title}}" class="popup-title">{{title}}</view> <view> </view> <view class="popup-con"> <image src="{{image}}" /> <view>{{content}}</view> </view> <view class="popup-btn"> <text class="btn-no" bindtap='_error'>{{btn_no}}</text> <text class="btn-ok" bindtap='_success'>{{btn_ok}}</text> </view> </view> </view> // components/popup/popup.js Component({ /** * Component properties */ properties: { title: { // 属性名 type: String, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object,