1.0.9 • Published 6 years ago

gnh-activity-modal v1.0.9

Weekly downloads
30
License
-
Repository
-
Last release
6 years ago

gnh-activity-modal

活动弹窗

使用

  1. 安装
npm install gnh-activity-modal -S
// or
yarn add gnh-activity-modal
  1. 引入
import GnhActivityModal from 'gnh-activity-modal'
...

components: {
    [GnhActivityModal.name]: GnhActivityModal
  }
...
  1. 使用
<gnh-activity-modal
  :closeBtn="require('./assets/close-btn.png')"
  :topImg="require('./assets/reward_mask.png')"
  :centerIcon="require('./assets/reward_success_icon.png')"
   @onHide="onHide"
  ref="modal"
  @onClick="clickHandle"
  />

// methods
 methods: {
    clickHandle (e) {
      this.$refs.modal.$hide()
      // 或者使用 this.$refs.modal.toggle()
    },
    onHide () {
      console.log('hide')
    }
  },

props

属性说明类型默认值
closeBtn关闭按钮图片使用require加载图片资源
topImg弹窗顶部图片使用require加载图片资源
centerIcon弹窗中间位置的图片使用require加载图片资源
centerIconWidth弹窗中间位置的图片的宽度String Number82
contentTitle主标题String确认加速该订单吗
contentSubTitle副标题String确认后不可修改
btnText按钮文案String确认
hasMask是否有遮罩Booleantrue
maskClosable遮罩点击是否关闭弹窗Booleantrue
onClick点击按钮触发的事件Function

slot 插槽

slot-name说明默认值
close-btn关闭按钮插槽closeBtn图片
modal-center中间内容插槽centerIcon图片icon
modal-bottom弹窗底部插槽确认按钮

方法

方法名说明示例
toggle切换弹窗状态this.$refs.modal.toggle()
$show展示弹窗this.$refs.modal.$show()
$hide关闭弹窗this.$refs.modal.$hide()

通知

方法名说明示例
onHide弹窗关闭时候触发
1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago