You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Current Behavior
When I open a link that is routed to X.vue, go back to previous page (home) and then open view Y.vue, the setup function of view X is run a second time. I verified this by a simple log message. Not only does this feel like a waste, it also resulted in weird behavior on our side when logging view access and assuming the url's id being set when on the page.
Expected Behavior
The setup function of a view should only be called when that view is actually being visited.
Steps to Reproduce
Run the code reproduction URL's code with npm run serve
Capacitor CLI : 3.2.5
@capacitor/android : not installed
@capacitor/core : 3.2.5
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.3
native-run : 1.5.0
System:
NodeJS : v14.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.8
OS : Windows 10
Additional Information
The project we first noticed this used version 5.4 of ionic vue and router, the reproduction url uses the latest version (5.8.4). I tested this on Chrome 94, but also noticed this on device (Android) with the same webview version.
Also, I'm not sure if this is Vue specific or in all Ionic versions.
The text was updated successfully, but these errors were encountered:
brease-colin
changed the title
bug: (vue) Opening route to view X.vue also executes setup for view Y.vue
bug: (vue) Opening route to view X.vue also executes setup for Y.vue
Oct 18, 2021
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
Current Behavior
When I open a link that is routed to X.vue, go back to previous page (home) and then open view Y.vue, the setup function of view X is run a second time. I verified this by a simple log message. Not only does this feel like a waste, it also resulted in weird behavior on our side when logging view access and assuming the url's id being set when on the page.
Expected Behavior
The setup function of a view should only be called when that view is actually being visited.
Steps to Reproduce
Code Reproduction URL
https://github.com/brease-colin/vue-router-view-setup-issue
Ionic Info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module
'@capacitor/ios/package'
[WARN] Error loading @capacitor/android package.json: Error: Cannot find module
'@capacitor/android/package'
Ionic:
Ionic CLI : 6.17.1 (C:\Users\CB\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/vue 5.8.4
Capacitor:
Capacitor CLI : 3.2.5
@capacitor/android : not installed
@capacitor/core : 3.2.5
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.3
native-run : 1.5.0
System:
NodeJS : v14.15.0 (C:\Program Files\nodejs\node.exe)
npm : 6.14.8
OS : Windows 10
Additional Information
The project we first noticed this used version 5.4 of ionic vue and router, the reproduction url uses the latest version (5.8.4). I tested this on Chrome 94, but also noticed this on device (Android) with the same webview version.
Also, I'm not sure if this is Vue specific or in all Ionic versions.
The text was updated successfully, but these errors were encountered: