unplugin / unplugin-vue2-script-setup

💡 Bring `<script setup>` to Vue 2.
MIT License
599 stars 39 forks source link

typescript TS7006 TS2339 error #130

Closed ylucifer closed 2 years ago

ylucifer commented 2 years ago

generated code:

import { ref } from "@vue/composition-api"; const sfc_main = {}; // TS7006 TS2339 error __sfc_main.setup = (props, ctx) => { // .... }; export default sfc_main;


expect code:

import { ref } from "@vue/composition-api"; const sfc_main = {} as any; __sfc_main.setup = (props : any, ctx : any) => { // .... }; export default sfc_main;

I don't know how to config this plugin execute after ts-loader

xiaoxiangmoe commented 2 years ago

Please disable type checking. See

https://github.com/antfu/unplugin-vue2-script-setup/blob/55f5753ed3ca6883d9abac1d3ff1c3d2216e8243/examples/vue-cli/vue.config.cjs#L17