You should use jsx inside file named Hello.jsx
without using template
and script
tags, and don't return a jsx from a property and return a function ()=>
to render the jsx, the following example should work :
import { ref, computed, defineComponent } from 'vue'
export default defineComponent({
name: 'CustomComponent',
setup() {
const name = ref('Lily')
const hello = computed(() => {
return `Hello ${name.value}!`;
})
return ()=><RenderComponent data={hello} />
}
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…