because shithub doesnt have ipv6 support
Find a file
2016-05-10 01:23:45 +03:00
example example update 2016-05-10 00:39:16 +03:00
bower.json bower init & minify 2016-05-09 16:17:18 +03:00
package.json version update 2016-05-09 19:28:25 +03:00
README.md Update README.md 2016-05-10 01:23:45 +03:00
vue-socketio.js okay? 2016-05-09 16:07:09 +03:00
vue-socketio.min.js minify 2016-05-09 16:36:06 +03:00

Vue-Socket.io

socket.io implemantation for vuejs

Install

npm install vue-socket.io --save

or

bower install vue-socket.io

Usage

import VueSocketio from 'vue-socket.io'; // for ES6

// var VueSocketio = require('vue-socket.io') // for commonjs

Vue.use(VueSocketio, 'http://socketserver.com:1923'); // Automaticly socket connect from url string

/*
  import socketio from 'socket.io-client';
  
  var ioInstance = socketio('http://socketserver.com:1923');
  
  Vue.use(VueSocketio, ioInstance); // bind custom socketio instance
*/

var vm = new Vue({
  sockets:{
    connect: function(){
      console.log('socket connected')
    },
    customEmit: function(){
      console.log('this method fired by socket server. eg: io.emit("customEmit", data)')
    }
  },
  methods: {
    clickButton: function(val){
        // $socket is socket.io-client instance
        this.$socket.emit('emit_method', val);
    }
  }
})

Example

Vue-Socket.io Example

License

WTFPL