Skip to content

Commit

Permalink
actionsheet: Support event: on-click-mask (Close #1496)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jun 1, 2017
1 parent 529448e commit f5f278e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/actionsheet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default {
}
},
onClickingMask () {
this.$emit('on-click-mask')
this.closeOnClickingMask && (this.show = false)
},
emitEvent (event, menu, shouldClose = true) {
Expand Down
9 changes: 9 additions & 0 deletions src/components/actionsheet/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ events:
on-click-menu-cancel:
en: triggers when clicking on the cancel menu
zh-CN: 点击取消菜单时触发
on-click-mask:
version: next
en: triggers when clicking on mask
zh-CN: 点击遮罩时触发
changes:
next:
en:
- '[feature] Support event: on-click-mask #1496'
zh-CN:
- '[feature] 支持遮罩点击事件 on-click-mask #1496'
v2.2.0:
en:
- '[enhance] Donot update handel z-index in Safari when using v-transfer-dom'
Expand Down
5 changes: 4 additions & 1 deletion src/demos/Actionsheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<x-switch :title="$t('Basic Usage')" v-model="show4"></x-switch>
</group>

<actionsheet v-model="show4" :menus="menus1" :close-on-clicking-mask="false" show-cancel></actionsheet>
<actionsheet v-model="show4" :menus="menus1" :close-on-clicking-mask="false" show-cancel @on-click-mask="console('on click mask')"></actionsheet>

<actionsheet v-model="show1" :menus="menus1" @on-click-menu="click"></actionsheet>

Expand Down Expand Up @@ -99,6 +99,9 @@ export default {
}
},
methods: {
console (msg) {
console.log(msg)
},
click (key) {
console.log(key)
},
Expand Down

0 comments on commit f5f278e

Please sign in to comment.