Closed GaoNeng-wWw closed 3 months ago
It should be createTextNode(() => visible.value ? 'visible' : 'not visible'])
It should be
createTextNode(() => visible.value ? 'visible' : 'not visible'])
Thank you for your answer, but I'm sorry I didn't explain it clearly. Please allow me to explain again. In Vue, defineComponent can dynamically return other components. But it is not supported by steam. Is there a problem with my usage method?
vvv Demo
const comp = defineComponent({
setup(){
const visible = ref(false);
setTimeout(() => {
visible.value = true;
}, 500);
const comp1 = defineComponent({
setup(){
return createTextNode(['visible'])
}
});
const comp2 = defineComponent({
setup(){
return createTextNode(['not visible'])
}
});
return createComponent(visible.value ? comp1 : comp2) //always return comp2
}
})
Try using the template explorer instead of manually writing compiled code.
There seem to be some points where the behavior differs from the original.
but in vapor mode