Your components should be registered globally or locally in components
option, and the reactive should take an object as parameter or you should use ref instead :
components:{
TemplateText
},
setup(props){
const state= reactive({components:[]});
state.components[0] = 'TemplateText';
state.components[1] = 'TemplateText';
return {state}
}
template :
<component v-for="(component, index) in state.components" :key="index" :is="component"></component>
if you want to just render your components multiple times just loop through a number without using a reactive stuff :
<TemplateText v-for="index in 2" :key="index"/>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…