Javascript 如何在vue中从main.js文件重新渲染组件?

Javascript 如何在vue中从main.js文件重新渲染组件?,javascript,vue.js,vuex,vuejs3,Javascript,Vue.js,Vuex,Vuejs3,我想从main.js重新加载我的组件notfication.vue main.js文件在全球范围内可用 在这个文件中,我收到了通知。收到通知后,我想重新启动组件 PushNotifications.addListener('pushNotificationReceived', async (notification) => { // Rerender notification component from here notificationComponent ???

我想从main.js重新加载我的组件
notfication.vue

main.js文件在全球范围内可用

在这个文件中,我收到了通知。收到通知后,我想重新启动组件

PushNotifications.addListener('pushNotificationReceived', 
  async (notification) => {
    // Rerender notification component from here

    notificationComponent ???

  }
);

一种解决方案是使用状态管理,例如vuex,将
notificationComponentKey
作为状态,并将其放在组件