Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve conflicts with vue2 interface #869

Merged
merged 4 commits into from
Dec 17, 2021
Merged

Conversation

MinatoHikari
Copy link
Contributor

#850

Vue2 renderComponent Interface is different from vue3 now.

It works for me to resolve type error when I use Mixins in vue-class-component

Maybe we can change it's type again after vue2.7

Copy link
Collaborator

@xiaoxiangmoe xiaoxiangmoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiaoxiangmoe
Copy link
Collaborator

xiaoxiangmoe commented Dec 15, 2021

@MinatoHikari Can you add some type test for this in directory /test-dts?
If tests are added, the usage of vue-class-component and emit will not to be affected in future updates.
Thank you very much.

@MinatoHikari
Copy link
Contributor Author

MinatoHikari commented Dec 16, 2021

One problem, type checking in vsCode or webStorm is fine but vue-tsc will be failed when using vue3 tsconfig.
@antfu @xiaoxiangmoe

Because $emit in vue3's mounted instance dosen't return itself., so something like this.$emit('click', 1).$emit('click', 1) can not pass (using /vue3/dist/vue.d.ts), but it can pass with vue2 tsconfig.

@xiaoxiangmoe
Copy link
Collaborator

@MinatoHikari Maybe we can remove vue-class-component and vue-property-decorator in devDependencies. Only extract simpler use case from it.

@MinatoHikari
Copy link
Contributor Author

MinatoHikari commented Dec 16, 2021

Remove vue-class-component and vue-property-decorator.
Use case of #850 to simulate vue-class-component since I got same error when using vue-class-component.
To avoid conflicts when using vue3 type, move some tests to defineComponent-vue2.d.tsx, add exclude file for tsconfig.vue3.json.

@antfu antfu changed the title resolve conflicts with vue2 interface fix: resolve conflicts with vue2 interface Dec 17, 2021
@antfu antfu merged commit e84b488 into vuejs:main Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants