1.0.2 • Published 3 years ago

wx-mini-dialog v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

wx-mini-dialog

微信小程序-弹窗组件

使用

  1. 安装
 npm install --save wx-mini-dialog
  1. 安装完成之后执行npm构建,小程序开发文档

  2. 在你的页面json中添加

{
  "usingComponents": {
    "dialog":  "wx-mini-dialog"
  }
}
  1. 在wxml中即可使用组件
 <button bindtap="changeStatus">button</button>
 <dialog visible="{{visible}}" bind:confirm="handleConfirm" bind:cancle="changeStatus">内容</dialog>
  1. 在 js 文件中添加逻辑
Component({
  data: {
	visible: false	
  },
  changeStatus() {
	this.setData({ visible: !this.data.visible })
  },
  handleConfirm() {
	// do something
	this.changeStatus();
  }
})

属性说明

属性类型默认值说明
visibleBooleanfalse控制弹窗显示隐藏
typeStringcenter弹窗类型,有效值:center,bottom
confirmTextString确定确认按钮文字内容
cancleTextString取消取消按钮文字内容
confirmColorString#07c160确认按钮颜色
cancleColorString#666666取消按钮颜色
showCloseBooleanfalse是否显示 关闭按钮
titleString底部弹窗的标题
showTitleBoolean底部弹窗是否展示标题

tips:隐藏按钮只需要传入空字符串

1.0.1

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago

1.0.3

5 years ago