When using this.$ionic.modalController to launch a modal, the component's this.$store isn't set.
Here is the error thrown by this.$store.state:
TypeError: Cannot read property 'state' of undefined
Same goes to vue-i18n, eg: this.$t('message.hello', { msg: 'hello' }) cannot be used in a modal:
"TypeError: Cannot read property '_t' of undefined"
I think it applies to basically all libs. I solved by importing those in the modal component.
import store from '../store';
import router from '../router';
export default {
store,
router,
// ...
}
Thanks for the issue! This issue is being closed due to inactivity. 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.
Thank you for using Ionic!
Most helpful comment
I think it applies to basically all libs. I solved by importing those in the modal component.