mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
add import vue in readme
This commit is contained in:
parent
a172f0219a
commit
f21cb5dfa6
1 changed files with 4 additions and 3 deletions
|
@ -11,19 +11,20 @@ socket.io implemantation for Vuejs 2.0 and 1.0
|
||||||
``` bash
|
``` bash
|
||||||
npm install vue-socket.io@1.0.2 --save
|
npm install vue-socket.io@1.0.2 --save
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
import Vue from 'vue';
|
||||||
import VueSocketio from 'vue-socket.io';
|
import VueSocketio from 'vue-socket.io';
|
||||||
|
|
||||||
Vue.use(VueSocketio, 'http://socketserver.com:1923'); // Automaticly socket connect from url string
|
Vue.use(VueSocketio, 'http://socketserver.com:1923'); // Automaticly socket connect from url string
|
||||||
|
|
||||||
/*
|
/*
|
||||||
import socketio from 'socket.io-client';
|
import socketio from 'socket.io-client';
|
||||||
|
|
||||||
var ioInstance = socketio('http://socketserver.com:1923');
|
var ioInstance = socketio('http://socketserver.com:1923');
|
||||||
|
|
||||||
Vue.use(VueSocketio, ioInstance); // bind custom socketio instance
|
Vue.use(VueSocketio, ioInstance); // bind custom socketio instance
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue