From de870997736d29254e31717402a76c487218fe3f Mon Sep 17 00:00:00 2001 From: "cmdltt@mail.ru" Date: Sun, 22 Sep 2024 20:59:04 +0300 Subject: [PATCH] fix: add an extra condition for tryOnMounted method --- packages/core/src/usestyle/UseStyle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/usestyle/UseStyle.js b/packages/core/src/usestyle/UseStyle.js index 95dd4b2b6b..ec35f3f0b0 100644 --- a/packages/core/src/usestyle/UseStyle.js +++ b/packages/core/src/usestyle/UseStyle.js @@ -6,7 +6,7 @@ import { isClient, isExist, setAttribute, setAttributes } from '@primeuix/utils/ import { getCurrentInstance, nextTick, onMounted, readonly, ref, watch } from 'vue'; function tryOnMounted(fn, sync = true) { - if (getCurrentInstance()) onMounted(fn); + if (getCurrentInstance() && getCurrentInstance().components) onMounted(fn); else if (sync) fn(); else nextTick(fn); }