|
@@ -3,6 +3,7 @@ import {
|
|
|
Static,
|
|
Static,
|
|
|
type VNode,
|
|
type VNode,
|
|
|
getCurrentInstance,
|
|
getCurrentInstance,
|
|
|
|
|
+ onBeforeMount,
|
|
|
onMounted,
|
|
onMounted,
|
|
|
onUnmounted,
|
|
onUnmounted,
|
|
|
warn,
|
|
warn,
|
|
@@ -42,8 +43,11 @@ export function useCssVars(getter: (ctx: any) => Record<string, string>) {
|
|
|
updateTeleports(vars)
|
|
updateTeleports(vars)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
|
|
+ onBeforeMount(() => {
|
|
|
watchPostEffect(setVars)
|
|
watchPostEffect(setVars)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ onMounted(() => {
|
|
|
const ob = new MutationObserver(setVars)
|
|
const ob = new MutationObserver(setVars)
|
|
|
ob.observe(instance.subTree.el!.parentNode, { childList: true })
|
|
ob.observe(instance.subTree.el!.parentNode, { childList: true })
|
|
|
onUnmounted(() => ob.disconnect())
|
|
onUnmounted(() => ob.disconnect())
|