Vue-ის <component :is> საშუალებას გაძლევთ შედეგი-დროში გადაწყვეტილ კომპონენტს რენდერი გააკეთოთ, ხოლო <KeepAlive> აკეშირებს იმ კომპონენტებს, რათა ისინი დაკარგავი არ გახდეს, როდესაც მათი აქტივობას გადაწყვეტ და ხელახლა დაბრუნდეთ.
დინამიური კომპონენტები <component :is>-ით
<script setup>
import { ref, shallowRef } from "vue";
import TabHome from "./TabHome.vue";
import TabProfile from "./TabProfile.vue";
const tabs = { home: TabHome, profile: TabProfile };
const current = shallowRef(TabHome); // which component to show
</script>
<template>
<button @click="current = tabs.home">Home</button>
<button @click="current = tabs.profile">Profile</button>
<component :is="current" /> <!-- renders whichever component `current` holds -->
</template>
