Skip to content

Commit

Permalink
picker modal click bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisHchen committed Nov 1, 2017
1 parent 1d29a8d commit 519e82e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## 版本更新日志
## v0.1.7

- 修复 date-picker 最值bug
- 修复 picker modal click bug
- 新增 picker close-on-click-modal 属性

## v0.1.6

Expand Down
1 change: 1 addition & 0 deletions example/components/pickerPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<za-panel-body>
<za-cell title="单列">
<za-picker
:close-on-click-modal='false'
:visible.sync='visible'
v-model='v1'
:dataSource='data1'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zarm-vue",
"version": "0.1.6",
"version": "0.1.7",
"description": "zarm in vue",
"author": "chrisHchen <[email protected]>",
"tags": [
Expand Down
16 changes: 13 additions & 3 deletions src/picker/src/picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
[`${prefixCls}-container`]: true,
[customCls]: !!customCls,
}' @click.stop='() => {}'>
<za-popup class='za-popup-inner' :visible='currentVisible' @close='onPopupClose'>
<za-popup
class='za-popup-inner'
:visible='currentVisible'
@close='onPopupClose'
:closeOnClickModal='closeOnClickModal'>
<div :class='`${prefixCls}-wrapper`'>
<div :class='`${prefixCls}-header`'>
<div :class='`${prefixCls}-cancel`' @click='handleCancel'>{{cancelText}}</div>
Expand Down Expand Up @@ -107,6 +111,10 @@ export default {
type: String,
default: 'value',
},
closeOnClickModal: {
type: Boolean,
default: true,
},
// custom value generator: receive value
displayGenerator: Function,
customCls: String,
Expand Down Expand Up @@ -207,8 +215,10 @@ export default {
},
onPopupClose(reason) {
if (reason === 'clickaway') {
this.currentVisible = !this.currentVisible;
this.$emit('update:visible', this.currentVisible);
this.toggle();
this.currentValue = this.oldValue;
// this.currentVisible = !this.currentVisible;
// this.$emit('update:visible', this.currentVisible);
}
},
handleCancel(event) {
Expand Down

0 comments on commit 519e82e

Please sign in to comment.