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

feature: rewrite to Composition API #446

Merged
merged 11 commits into from
Mar 31, 2024
Merged

feature: rewrite to Composition API #446

merged 11 commits into from
Mar 31, 2024

Conversation

daniil4udo
Copy link
Contributor

@daniil4udo daniil4udo commented Mar 7, 2024

I know it's a lot of changes... I didn't change any logic, just an attempt to add typings and Composition API

  • Why Vue version upgraded? To be able to use defineModel
  • Why getDefault moved to the utils.ts - there's an important limitation to keep in mind: defineProps() (and similar functions like defineEmits() or useSlots()) cannot reference locally declared variables within the same <script setup> block. This limitation arises because these API calls are hoisted outside of the setup function by the Vue compiler during the SFC compilation process. Hoisting means that these calls are moved to the top of the module scope, so they execute before any local variables are defined, thus they cannot reference those variables.

@iamstevendao
Copy link
Owner

@daniil4udo wow! that's huge & looks promising. thanks for your help!
Before we can merge, could you revert the formatting changes in vue-tel-input.vue? I assume it came automatically from your IDE and could be turned off? Just so it's easier for me to validate the actual changes. Thanks!

@daniil4udo
Copy link
Contributor Author

daniil4udo commented Mar 19, 2024

Did for the template. Not sure I can do it inside the script tag. also made tests work + added extra

@iamstevendao
Copy link
Owner

@daniil4udo that's awesome! thanks a heap!

@iamstevendao iamstevendao merged commit a23eab5 into iamstevendao:main Mar 31, 2024
iamstevendao added a commit that referenced this pull request Mar 31, 2024
@iamstevendao
Copy link
Owner

@daniil4udo there are some errors when I try npm run build. could you help, please? thanks!

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.

2 participants