1.0.12 • Published 6 years ago

vue-stomp-ds v1.0.12

Weekly downloads
9
License
MIT
Repository
-
Last release
6 years ago

vue-stomp-ds

vue stomp 协议客户端需要配合http://10.168.4.20:8099/daoshu/public-architecture.git 中public-architecture/common-platform/platform/daoshu-message后端一起使用

使用帮助

下载

npm install vue-stomp-ds -S

使用

1.在main.js中引入vue-stomp-ds,例如:

import VueStomp from 'vue-stomp-ds'

Vue.use(VueStomp, 'http://localhost:9050/msg-websocket')

2.在需要引入stomp的组件中直接使用vue-stomp-ds,方法:

connectWM

参数:


用法:

this.connetWM('http://localhost:9050/msg-websocket?userId=01', headers, this.onConnected, this.onFailed);    

subscribe

参数:


用法:

this.$stompClient.subscribe('/topic/username', this.responseCallback, this.onFailed);

sendWM

参数:


用法:

this.sendWM(destination, JSON.stringify(body), invokeId, this.responseCallback, 3000);

sendToUser

参数:


用法:

this.sendToUser(user, JSON.stringify(body), invokeId, this.responseCallback, 3000);

stompClient

参数:


用法:

export default {
    name: 'App',
    mounted() {
    },
    stompClient: {
      monitorIntervalTime: 1000,
      stompReconnect: true,
      timeout(orgCmd) {
      	console.log('orgCmd', orgCmd)
      },
      reconnectTimes: 10,
      reconnectIntervalTime: 30000
    }
}
1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago