系统自带

具体查看:
https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showModal.html

  1. wx.showModal({
  2. cancelText: '取消',
  3. confirmText:'确定',
  4. title:'标题',
  5. content:'内容内容'
  6. })

效果图:
image.png

自定义弹窗

标签
image.png

  1. <modal title="弹窗" hidden="{{dialogFlag}}" bindconfirm="dialogClick" bindcancel="dialogClick" no-cancel="false">
  2. <image src="{{lists[selectIndex].largeImageURL}}" class="imgCss"></image>
  3. <text>作者:{{lists[selectIndex].user}}</text>
  4. </modal>

使用dataFlag控制弹窗是否显示,
效果图:
image.png