mirror of https://github.com/vuejs/core.git
parent
e359ff0046
commit
fdc2a31dbd
|
@ -3,6 +3,7 @@ import {
|
|||
Static,
|
||||
type VNode,
|
||||
getCurrentInstance,
|
||||
onBeforeMount,
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
warn,
|
||||
|
@ -42,8 +43,11 @@ export function useCssVars(getter: (ctx: any) => Record<string, string>) {
|
|||
updateTeleports(vars)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onBeforeMount(() => {
|
||||
watchPostEffect(setVars)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
const ob = new MutationObserver(setVars)
|
||||
ob.observe(instance.subTree.el!.parentNode, { childList: true })
|
||||
onUnmounted(() => ob.disconnect())
|
||||
|
|
Loading…
Reference in New Issue