Views: 2739
Last Modified: 28.04.2022
  • When you have used app-level events:

    this.$root.$on(...)
    this.$root.$off(...)
    this.$root.$emit(...)
    

    You need to rollback to BitrixVue 3 integrated EventEmitter:

    this.$Bitrix.eventEmitter.subscribe(...)
    this.$Bitrix.eventEmitter.unsubscribe(...)
    this.$Bitrix.eventEmitter.emit(...)
    

    You can find more details on integrated EventEmitter in this article: Event-driven model (App-level events).

  • If you have used global event bus (EventBus)

    Such pattern was used previously in BitrixVue 2 within Bitrix Framework in earlier versions, for communications between different Vue applications at a single page.

    Such approach isn't applicable in BitrixVue 3, that's why you need to replace old calls with new ones. For this purpose, use global EventEmitter from Core.js library within the extension main.core.events.

    Before:

    Vue.event.$on(...)
    Vue.event.$off(...)
    Vue.event.$emit(...)
    

    Now:

    EventEmitter.subscribe(...)
    EventEmitter.unsubscribe(...)
    EventEmitter.emit(...)
    

    You can find more details about the basic EventEmitter in the article: Event-driven model (Site-level events).





Courses developed by Bitrix24