README.MD Example Usage Updates (#198)

* Fix Spelling

- Rename `Listenler` to `Listener`

* Add Options to Connection

- Add options which can be passed to connection string for `SocketIO`

* Build New Version

* Fix spelling in Package.json

- Change `implemantation` to `implementation`
- Change `vuejs` to `Vue.js`
- Change `vuex` to `VueX`

* Updates to index.js

- Add `options` to JSDocs for constructor
- Fix spelling for JSDoc on `install` and `connect` methods

* Update README.MD

- Add example of connecting using socket.io-client instance

* Update README.MD

- Add options example using connection string

* Update README.MD

- Add options example using connection string

* Remove unnecessary white space
pull/199/head
Evan bechtol 6 years ago committed by Metin Seylan
parent f1e03525c0
commit 381cb5fdd0

@ -27,7 +27,7 @@ are you looking for old documentation? <a href="https://github.com/MetinSeylan/V
``` bash
npm install vue-socket.io --save
```
##### Using Connection String
``` javascript
import Vue from 'vue'
import store from './store'
@ -41,7 +41,8 @@ Vue.use(new VueSocketIO({
store,
actionPrefix: 'SOCKET_',
mutationPrefix: 'SOCKET_'
}
},
options: { path: "/my-app/" } //Optional options
}))
new Vue({
@ -51,6 +52,33 @@ new Vue({
}).$mount('#app')
```
##### Using socket.io-client Instance
``` javascript
import Vue from 'vue'
import store from './store'
import App from './App.vue'
import VueSocketIO from 'vue-socket.io'
const options = { path: '/my-app/' }; //Options object to pass into SocketIO
Vue.use(new VueSocketIO({
debug: true,
connection: SocketIO('http://metinseylan.com:1992', options), //options object is Optional
vuex: {
store,
actionPrefix: "SOCKET_",
mutationPrefix: "SOCKET_"
}
})
);
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
```
**Parameters**|**Type's**|**Default**|**Required**|**Description**
-----|-----|-----|-----|-----
debug|Boolean|`false`|Optional|Enable logging for debug

Loading…
Cancel
Save