mirror of https://github.com/vuejs/core.git
parent
e359ff0046
commit
fdc2a31dbd
|
@ -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())
|
||||||
|
|
Loading…
Reference in New Issue