You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ff2063b3be | 6 years ago | |
---|---|---|
dist | 6 years ago | |
docs | 6 years ago | |
src | 6 years ago | |
.gitignore | 6 years ago | |
.npmignore | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
package.json | 6 years ago | |
webpack.config.js | 6 years ago |
README.md
Vue-Socket.io is a socket.io integration for Vuejs, easy to use, supporting Vuex and component level socket consumer managements
Demo
🚀 Installation
npm install vue-socket.io --save
import Vue from 'vue'
import store from './store'
import App from './App.vue'
import VueSocketIO from 'vue-socket.io'
Vue.use(new VueSocketIO({
debug: true,
connection: 'http://metinseylan.com:1992',
vuex: {
store,
actionPrefix: 'SOCKET_',
mutationPrefix: 'SOCKET_'
}
}))
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app');
Parameters | Type's | Default | Description |
---|---|---|---|
debug | Boolean | false |
Enable logging for debug |
connection | String/Socket.io-client | null |
Websocket server url or socket.io-client instance |
vuex.store | Vuex | null |
Vuex store instance |
vuex.actionPrefix | String | null |
Prefix for emitting server side vuex action |
vuex.mutationPrefix | String | null |
Prefix for emitting server side vuex mutation |