because shithub doesnt have ipv6 support
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.
 
Go to file
Metin Seylan 4652f6eec0 Update README.md 9 years ago
example example update 9 years ago
README.md Update README.md 9 years ago
bower.json bower init & minify 9 years ago
package.json version update 9 years ago
vue-socketio.js okay? 9 years ago
vue-socketio.min.js minify 9 years ago

README.md

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