You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open project in vscode with Volar v1.8.8 and Volar TS v1.8.8
go to app.vue and todo-list/index.tsx
search lines marked with ERROR:, or hover the error underscores by TS
What is expected?
defineComponent with Function Signature can work properly
use all component prop: ref, class, style ...
use SetupContext when using generic setup: emit, expose ...
What is actually happening?
<TodoList1> use defineComponent Function Signature. But can't use ref in this component.
<!-- ERROR: ref does not exist in TodoProps type -->
<TodoList1 v-model="data1" ref="ref1"/>
and using generic in defineComponent, SetupContext can't infer in setup's second parameter
exportconstTodoList3=defineComponent(<Dataextendsstring|number>(props: {modelValue:Data[]},{ emit }// ERROR: Binding element 'emit' implicitly has an 'any' type.ts(7031))=>{
Vue version
3.3.4
Link to minimal reproduction
https://gitee.com/xxx8848/vue-definecomponent-demo
Steps to reproduce
app.vue
andtodo-list/index.tsx
ERROR:
, or hover the error underscores by TSWhat is expected?
defineComponent
with Function Signature can work properlySetupContext
when using generic setup: emit, expose ...What is actually happening?
<TodoList1>
usedefineComponent
Function Signature. But can't useref
in this component.<!-- ERROR: ref does not exist in TodoProps type --> <TodoList1 v-model="data1" ref="ref1"/>
and using generic in
defineComponent
,SetupContext
can't infer in setup's second parameterSystem Info
Any additional comments?
digging into vue's type definition, i find the
defineComponent
for use setup directly and genericand its return type is
only infer
Props
and parsedEmits
defined by user, doesn't append compnent's props to it, likeit's designed that user can't use these prop in this function signature?
The text was updated successfully, but these errors were encountered: