mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [message] set appentTo value (#8730)
* fix(components): [message] set appentTo value * feat: update judge
This commit is contained in:
@@ -41,7 +41,9 @@ const normalizeOptions = (params?: MessageParams) => {
|
||||
...options,
|
||||
}
|
||||
|
||||
if (isString(normalized.appendTo)) {
|
||||
if (!normalized.appendTo) {
|
||||
normalized.appendTo = document.body
|
||||
} else if (isString(normalized.appendTo)) {
|
||||
let appendTo = document.querySelector<HTMLElement>(normalized.appendTo)
|
||||
|
||||
// should fallback to default value with a warning
|
||||
|
||||
Reference in New Issue
Block a user