<template> <div class="home-content"> <component :is="componentVal"></component> </div> </template> <script> import HomeOne from './test/HomeOne' import HomeTwo from './test/HomeTwo' import { ref } from 'vue' export default { components: { HomeOne, HomeTwo }, setup () { const componentVal = ref('HomeTwo') return { componentVal } } } </script> <style> </style>