Skip to content

notification-bar 消息通知栏

notification-bar 是一个顶部消息通知栏组件,集成 Vuex 状态管理,用于展示即时消息。

基础用法

vue
<template>
  <notification-bar></notification-bar>
</template>

依赖

该组件依赖 Vuex store 中的 onlineChat 模块,需确保 store 中有如下状态:

  • showNotification: Boolean
  • eventSource: EventSource 对象
  • disabled: Boolean

交互

  • 点击通知栏可跳转至客服页面 /pages/subPack/user/contact-service
  • 自动在 5 秒后消失。