[bugfix] Popup: lock-scroll not work when open multi popup (#842)

This commit is contained in:
neverland
2018-04-10 10:39:54 +08:00
committed by GitHub
parent 91f44010e7
commit 1b6f9ba075
6 changed files with 111 additions and 49 deletions
+2 -4
View File
@@ -9,10 +9,8 @@ const defaultConfig = {
export default {
open(vm, config) {
const exist = context.stack.some(item => item.vm._popupId === vm._popupId);
/* istanbul ignore next */
if (!exist) {
if (!context.stack.some(item => item.vm._popupId === vm._popupId)) {
const el = vm.$el;
const targetNode = el && el.parentNode && el.parentNode.nodeType !== 11 ? el.parentNode : document.body;
context.stack.push({ vm, config, targetNode });
@@ -66,7 +64,7 @@ export default {
if (context.top) {
const { vm } = context.top;
vm.$emit('click-overlay');
vm.closeOnClickOverlay && vm.close();
vm.closeOnClickOverlay && vm.$emit('input', false);
}
}
};