-
Notifications
You must be signed in to change notification settings - Fork 13.5k
fix(vue): ionic lifecycle hooks now run when using vue 3.2 setup syntax #24253
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
Conversation
when use setup script, define properties on instance need use defineExpose to declare which property can be access outside (like private and public property). so line 82 will not work... My solution at line 85 is making a reference to the lifecycle array to the expose property source object.
comment update
Thanks for the PR! We appreciate the work you put in to create this fix. In order for this PR to be accepted, can you please add some tests to verify this new behavior? It might be easiest to add some tests to the |
ok. |
sadly , I still can't find a way to simulate the case when use script-setup sugar, looks like used additional compile to handle codes which test-utils not cover those part . Will check later. Before that, ^_^ anyone meet this case ,just need copy changes to local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up adding some E2E tests. This PR is good to merge when all the tests pass. Thank you for submitting this!
Merged. Thank you! |
This issue has a problem with following the latest documentation on how to build vite ionic, and then removing ts does not and cannot work properly with the lifecycle and script setup. #28681 |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: #23824
What is the new behavior?
Define a property on vue instance exposed source object make the hooks be public then they can be access and fire;
Does this introduce a breaking change?
Other information