Skip to content

Commit

Permalink
popup: Auto hide popup on deactived (fix #1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jul 31, 2017
1 parent dc52b76 commit a1b1af3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export default {
default: 'bottom'
},
maxHeight: String,
popupStyle: Object
popupStyle: Object,
hideOnDeactivated: {
type: Boolean,
default: true
}
},
mounted () {
this.$overflowScrollingList = document.querySelectorAll('.vux-fix-safari-overflow-scrolling')
Expand Down Expand Up @@ -64,6 +68,11 @@ export default {
this.initialShow = false
})
},
deactivated () {
if (this.hideOnDeactivated) {
this.show = false
}
},
methods: {
/**
* https://github.com/airyland/vux/issues/311
Expand Down
11 changes: 11 additions & 0 deletions src/components/popup/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ props:
type: Object
en: popup style
zh-CN: 弹窗样式,可以用于强制指定 z-index
hide-on-deactivated:
version: next
type: Boolean
default: true
en: whether hide popup on deactived event when using keep-alive
zh-CN: 是否在 deactived 事件触发时自动关闭,避免在路由切换时依然显示弹窗
events:
on-hide:
en: emits when then popup is closed
Expand All @@ -64,6 +70,11 @@ slots:
en: content body
zh-CN: 弹窗主体内容
changes:
next:
en:
- '[feature] Auto hide popup on deactived #1774'
zh-CN:
- '[feature] 在 deactived 事件触发时自动关闭,避免在路由切换时依然显示弹窗,可以使用 prop:hide-on-deactivated 进行禁用 #1774'
v2.5.2:
en:
- '[feature] Add prop:popup-style #1656'
Expand Down

0 comments on commit a1b1af3

Please sign in to comment.