Using `defineComponent` in `<script>` with `<script setup>` takes type error
For components which using both <script>
and <script setup>
, and using defineComponent
in <script>
, when I try to generate declaration files from the compilation results, type errors are issued.
Version
3.2.21
Reproduction link
Steps to reproduce
Use vscode to open any project which contains vue and typescript dependencies (can use vite-create
to create a vue-ts project), then copy sfc js compilation result into a new ts file.
This is to simulate type diagnostic when generate declaration files.
What is expected?
No type error occurred.
What is actually happening?
defineComponent
returned type is not assignable to parameter type.
In official example is export a native object, it seems to be the best practice.
If so, there will be some warnings when the usage is not recommended?
Thank you.