@latelier/vue-signalr
vue-signalr
Installation
$ npm install @latelier/vue-signalr --save
Get started
import Vue from 'vue'
import VueSignalR from 'vue-signalr'
Vue.use(VueSignalR, 'SOCKET_URL');
new Vue({
el: '#app',
render: h => h(App),
created() {
this.$socket.start({
log: false // Active only in development for debugging.
});
},
});
Example with component
Vue.extend({
...
methods: {
someMethod() {
this.$socket.invoke('socketName', payloadData)
.then(response => {
...
})
}
async someAsyncMethod() {
const response = await this.$socket.invoke('socketName', payloadData)
...
}
},
// Register your listener here.
sockets: {
// Equivalent of
// signalrHubConnection.on('someEvent', (data) => this.someActionWithData(data))
someEvent(data) {
this.someActionWithData(data)
}
otherSomeEvent(data) {
this.otheSomeActionWithOtherSomeData(data)
}
}
});
Related Packages
@scanupload/qr-code-generator-vue
Vue 3 wrapper for the ScanUpload QR Code Generator — QR code component with real...
923
Version History
| Version | Released | License |
|---|---|---|
| 2.0.4 | MIT | |
| 2.0.3 | MIT | |
| 2.0.2 | MIT | |
| 2.0.1 | MIT | |
| 2.0.0 | MIT | |
| 1.1.9 | MIT | |
| 1.1.8 | MIT | |
| 1.1.7 | MIT | |
| 1.1.6 | MIT | |
| 1.1.5 | MIT | |
| 1.1.4 | MIT | |
| 1.1.3 | MIT | |
| 1.1.2 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.0.3 | MIT | |
| 0.0.2 | MIT | |
| 0.0.1 | MIT |