vitejs / vite-plugin-vue2-jsx

Vite plugin for Vue 2.7 JSX support
MIT License
58 stars 6 forks source link

vue2.7 tsx使用<> </>编译出错 #2

Closed GaoJuqian closed 2 years ago

GaoJuqian commented 2 years ago
import { defineComponent, toRefs, reactive } from "vue";

export default defineComponent({
    name: 'Home',
    props: {
        title: {
            type: [String, Number],
            default: '123'
        },
    },
    setup(props, context) {

        const state = reactive({
            count: 1
        })
        return {
            ...toRefs(state),
        }
    },
    render() {
        const {count} = this;
        console.log(count);
        return (
            <>
                {count}<button onClick={(e)=> this.count++}>点击</button>
            </>
        )
    }
})
image
haoqunjiang commented 2 years ago

2.7 不支持 Fragment