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 77a06779dc Added Missing Events
Added Missing Events
8 years ago
dist v2 8 years ago
src Added Missing Events 8 years ago
.gitignore v2 8 years ago
README.md v2 8 years ago
package.json v2 8 years ago
webpack.config.js v2 8 years ago

README.md

Vue-Socket.io

socket.io implemantation for Vuejs 2.0 and 1.0

Install

npm install vue-socket.io --save

for Vue 1.0

npm install vue-socket.io@1.0.2 --save

Usage

import VueSocketio from 'vue-socket.io';

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(val){
      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

Realtime Car Tracker System

Simple Chat App

License

WTFPL