diff --git a/packages/devtools/src/init.ts b/packages/devtools/src/init.ts index 6fde326a..663768e0 100644 --- a/packages/devtools/src/init.ts +++ b/packages/devtools/src/init.ts @@ -1,4 +1,4 @@ -import { App, getCurrentInstance, nextTick, onUnmounted, watch } from 'vue'; +import { App, getCurrentInstance, nextTick, onMounted, onUnmounted, watch } from 'vue'; import { throttle } from 'packages/shared/src'; import { FormField, FormReturns } from '@core/index'; import { isSSR } from '@core/utils/common'; @@ -166,9 +166,9 @@ export function registerField(field: FormField, type: string) { deep: true, }); + // TODO: Figure out why this is needed + onMounted(() => setTimeout(refreshInspector, 500)); onUnmounted(refreshInspector); - - refreshInspector(); } export function registerForm(form: FormReturns) { @@ -179,7 +179,7 @@ export function registerForm(form: FormReturns) { deep: true, }); + // TODO: Figure out why this is needed + onMounted(() => setTimeout(refreshInspector, 500)); onUnmounted(refreshInspector); - - refreshInspector(); } diff --git a/packages/playground/src/App.vue b/packages/playground/src/App.vue index 51f89711..eba1cf77 100644 --- a/packages/playground/src/App.vue +++ b/packages/playground/src/App.vue @@ -11,6 +11,7 @@ import RadioItem from '@/components/RadioItem.vue'; import Switch from '@/components/Switch.vue'; import InputTextArea from '@/components/InputTextArea.vue'; import AllForm from './components/AllForm.vue'; +import { ref } from 'vue'; const min = new Date(2025, 0, 4, 0, 0, 0, 0); const value = new Date('2025-01-15'); @@ -21,6 +22,8 @@ const options = [ { label: 'Option 2', value: '2' }, { label: 'Option 3', value: '3' }, ]; + +const isNotificationsEnabled = ref(false);