Open Zclhlmgqzc opened 3 years ago
You might want to open a PR. But you will need to explain yourself (in English) Ines off just post pictures
@posva I added some background information
@posva @pikax The type of Component.props
is missing after wrapping the defineComponent
method, which makes it difficult to create HOC.
import { defineComponent } from 'vue';
const Component1 = {
props: {
foo: String,
},
};
const Component2 = defineComponent(Component1);
Component1.props; // --> { foo: StringConstructor }
Component2.props; // --> any
DefineComponent
, which breaks component definitions generated via tsc/vue-tsc, and a number of other cases.We need to find a way to do it while preserving the current argument order of DefineComponent
.
@yyx990803
There must be a way to send type, attrs only takes data, but if we define interface, at least volar can collect both props and attrs types. This feature opens it to libraries like the read-ui.
Couldn't it be easy to send attrs an interface or type as we can write props in a simple way?
Version
3.0.11
Reproduction link
https://github.com/youzan/vant/issues/8701
Steps to reproduce
What is expected?
What is actually happening?