[new feature] Toast: add get-container prop (#2724)
This commit is contained in:
@@ -140,18 +140,22 @@ export default {
|
||||
|
||||
move() {
|
||||
let container;
|
||||
|
||||
const { getContainer } = this;
|
||||
|
||||
if (getContainer) {
|
||||
container =
|
||||
typeof getContainer === 'string'
|
||||
? document.querySelector(getContainer)
|
||||
: getContainer();
|
||||
if (typeof getContainer === 'string') {
|
||||
container =
|
||||
getContainer === 'body'
|
||||
? document.body
|
||||
: document.querySelector(getContainer);
|
||||
} else {
|
||||
container = getContainer();
|
||||
}
|
||||
} else if (this.$parent) {
|
||||
container = this.$parent.$el;
|
||||
}
|
||||
|
||||
if (container) {
|
||||
if (container && container !== this.$el.parentNode) {
|
||||
container.appendChild(this.$el);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user