1313 ]"
1414 :style =" { width: typeof width === 'number' ? `${width}px` : width }"
1515 :aria-labelledby =" props.title && !showSkeleton ? bladeTitleId : undefined"
16- :aria-label =" ( !props.title || showSkeleton) ? $t('COMPONENTS.VC_BLADE.PANEL') : undefined"
16+ :aria-label =" !props.title || showSkeleton ? $t('COMPONENTS.VC_BLADE.PANEL') : undefined"
1717 >
1818 <!-- Header zone: v-show keeps BladeHeader mounted to avoid Teleport unmount bug -->
1919 <template v-if =" ! ($isMobile .value && blades .length === 1 && ! $slots [' actions' ])" >
9090 :items =" toolbarItems"
9191 >
9292 <template #widgets-container >
93- <WidgetContainer :blade-id =" blade?.id ?? '' " />
93+ <WidgetContainer :blade-id =" bladeId " />
9494 </template >
9595 </BladeToolbar >
9696
119119 </div >
120120</template >
121121<script lang="ts" setup>
122- import { ref , inject , computed , onMounted , nextTick , getCurrentInstance } from " vue" ;
122+ import { ref , inject , computed , onMounted , nextTick , watch , getCurrentInstance } from " vue" ;
123123import { IBladeToolbar } from " @core/types" ;
124- import { BladeStackKey } from " @shared/components/blade-navigation/types " ;
124+ import { useBladeNavigation , useBladeStack } from " @shared/components/blade-navigation/composables " ;
125125import BladeHeader from " @ui/components/organisms/vc-blade/_internal/BladeHeader.vue" ;
126126import BladeHeaderSkeleton from " @ui/components/organisms/vc-blade/_internal/BladeHeaderSkeleton.vue" ;
127127import BladeToolbar from " @ui/components/organisms/vc-blade/_internal/BladeToolbar.vue" ;
128128import BladeToolbarSkeleton from " @ui/components/organisms/vc-blade/_internal/BladeToolbarSkeleton.vue" ;
129129import BladeContentSkeleton from " @ui/components/organisms/vc-blade/_internal/BladeContentSkeleton.vue" ;
130130import BladeStatusBanners from " @ui/components/organisms/vc-blade/_internal/BladeStatusBanners.vue" ;
131131import { VcButton } from " @ui/components/atoms/vc-button" ;
132- import { BladeInstance , BLADE_BACK_BUTTON } from " @framework/injection-keys" ;
132+ import { BladeInstance , BLADE_BACK_BUTTON , BladeBackButtonKey , BladeInstanceKey } from " @framework/injection-keys" ;
133133import WidgetContainer from " @ui/components/organisms/vc-blade/_internal/widgets/WidgetContainer.vue" ;
134134import { DEFAULT_BLADE_INSTANCE } from " @ui/components/organisms/vc-blade/constants" ;
135+ import { useBlade } from " ../../../../core/composables" ;
135136
136137export interface Props {
137138 icon? : string ;
@@ -166,16 +167,7 @@ const props = withDefaults(defineProps<Props>(), {
166167const instanceUid = getCurrentInstance ()?.uid ?? 0 ;
167168const bladeTitleId = ` blade-title-${instanceUid } ` ;
168169
169- // Prevent flash of empty content on initial render.
170- // useAsync starts with loading=false; the action (setting true) runs in onMounted.
171- // Without this guard, VcBlade renders real (empty) content for 1 frame before skeleton appears.
172- const isInitializing = ref (props .loading !== undefined );
173- onMounted (() => {
174- nextTick (() => {
175- isInitializing .value = false ;
176- });
177- });
178- const showSkeleton = computed (() => Boolean (props .loading ) || isInitializing .value );
170+ const showSkeleton = computed (() => Boolean (props .loading ));
179171
180172const slots = defineSlots <{
181173 actions(): void ;
@@ -184,12 +176,13 @@ const slots = defineSlots<{
184176
185177const emit = defineEmits <Emits >();
186178
187- const blade = inject (BladeInstance , DEFAULT_BLADE_INSTANCE );
179+ const { id : bladeId } = useBlade ();
180+
181+ const blade = inject (BladeInstanceKey , DEFAULT_BLADE_INSTANCE );
188182
189- const backButton = inject (BLADE_BACK_BUTTON );
183+ const backButton = inject (BladeBackButtonKey );
190184
191- const bladeStack = inject (BladeStackKey );
192- const blades = computed (() => bladeStack ?.blades .value ?? []);
185+ const { blades } = useBladeStack ();
193186
194187const bladeRef = ref <HTMLElement | null >(null );
195188const contentRef = ref <HTMLElement | null >(null );
0 commit comments