common-notification
Version:
notification
28 lines (25 loc) • 679 B
Markdown
# 公共消息模块组件
## 安装依赖
```
npm install common-notification
```
### 开始使用
```
1:在main.js文件中引入
import SelfNotification from 'common-notification'
Vue.use(SelfNotification)
2:在需要的文件中使用
<SelfNotification :requestUrl="url" :token="token" :socketPath="WebSocketPath" :isOpen="isOpen" @update:isOpen="listenOpen"></SelfNotification>
data(){
return{
url: 'https://profile-api.ddmarketinghub.com',
token: "Bearer " + yourIdToken,
WebSocketPath: notification的websocket链接,
isOpen: 默认是否打开 true/false
}
}
methods: {
// 检测当前状态是否是打开状态
listenOpen(isOpen) {}
}
```