bug: vue, lifecycle hooks not fired with vue 3.2 setup
See original GitHub issuePrequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
Current Behavior
This code in component is never trigger :
onIonViewDidEnter(() => {
console.log('About page did enter');
});
onIonViewDidLeave(() => {
console.log('About page did leave');
});
onIonViewWillEnter(() => {
console.log('About page will enter');
});
onIonViewWillLeave(() => {
console.log('About page will leave');
});
Expected Behavior
this should be triggered during routing
Steps to Reproduce
you can clone : https://github.com/riderx/ionicv6-beta-vue-vite
yarn
and
yarn dev
Code Reproduction URL
https://github.com/riderx/ionicv6-beta-vue-vite
Ionic Info
Ionic:
Ionic CLI : 6.17.0
Utility:
cordova-res (update available: 0.15.3) : 0.15.2 native-run : 1.4.0
System:
NodeJS : v16.7.0 npm : 7.20.3 OS : macOS Monterey
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7 (4 by maintainers)
Top Results From Across the Web
bug: vue, lifecycle hooks not fired with vue 3.2 setup · Issue ...
This looks like an incompatibility with the new <script setup> feature in Vue 3.2.
Read more >A Complete Guide to Vue Lifecycle Hooks - with Vue 3 Updates
The updated lifecycle event is triggered whenever reactive data is modified, triggering a render update. beforeUpdate() and onBeforeUpdate().
Read more >Composition API: Lifecycle Hooks - Vue.js
This hook can be used to access the DOM state before Vue updates the DOM. It is also safe to modify component state...
Read more >use onMounted Hook - vue.js - Stack Overflow
I get this errors: [Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs ......
Read more >Vue 3 Script Setup, The Future Of Vue? Tutorial And Setup
Vue.js has a new Script Setup feature that is changing the way you create Vue apps. Should you use it? In this video...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/24253, and a fix will be available in an upcoming release of Ionic Framework.
Big thanks to @snowwolfjay for creating the fix!
any progress? because the router cache, it looks like disaster, because when you just need open one page, it open five visited for you… go(-1)/replace / back not clear the cache.