Vue3 Framework7 method $on not working

I’m migrating a project that I have from framework7 vue to the new version of it, however, in this change, a function that used to work, stopped working and started giving an error…

The function I have is as follows:

let self = this;
self.$root.$on('formSuccess', (data) => {

But I have this Error:

Uncaught (in promise) TypeError: self.$root.$on is not a function

Was there a change in the $root variable? How can I update this code to work?


It is how Vue 3 works, you can look for workarounds here javascript - Access this.$root in Vue.js 3 setup() - Stack Overflow