[new feature] Dialog: add getContainer option (#3040)

This commit is contained in:
neverland
2019-03-22 15:13:30 +08:00
committed by GitHub
parent 5a44d204bd
commit c1adaebaa6
9 changed files with 25 additions and 22 deletions
+4 -8
View File
@@ -143,14 +143,10 @@ export const PopupMixin = {
const { getContainer } = this;
if (getContainer) {
if (typeof getContainer === 'string') {
container =
getContainer === 'body'
? document.body
: document.querySelector(getContainer);
} else {
container = getContainer();
}
container =
typeof getContainer === 'string'
? document.querySelector(getContainer)
: getContainer();
} else if (this.$parent) {
container = this.$parent.$el;
}