fix(components): [loading] Compatible with vue3.2.0~12 (#12377)

* fix(components): [loading] Compatible with vue3.2.0~12

* fix(components): [loading] add comment
This commit is contained in:
Xc 2023-04-30 01:52:36 +08:00 committed by GitHub
parent fb1117afe1
commit 74daf8bd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,10 @@ const addStyle = async (
parent: HTMLElement,
instance: LoadingInstance
) => {
const { nextZIndex } = (instance.vm as any).zIndex as UseZIndexReturn
// Compatible with the instance data format of vue@3.2.12 and earlier versions #12351
const { nextZIndex } =
((instance.vm as any).zIndex as UseZIndexReturn) ||
(instance.vm as any)._.exposed.zIndex
const maskStyle: CSSProperties = {}
if (options.fullscreen) {
@ -140,7 +143,10 @@ const addClassList = (
parent: HTMLElement,
instance: LoadingInstance
) => {
const ns = (instance.vm as any).ns as UseNamespaceReturn
// Compatible with the instance data format of vue@3.2.12 and earlier versions #12351
const ns =
((instance.vm as any).ns as UseNamespaceReturn) ||
(instance.vm as any)._.exposed.ns
if (
!['absolute', 'fixed', 'sticky'].includes(instance.originalPosition.value)