mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
add: namespace name property to options object
This commit is contained in:
parent
b88edd089e
commit
57d422f7c1
1 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,8 @@ export default class VueSocketIO {
|
||||||
|
|
||||||
Logger.debug = debug;
|
Logger.debug = debug;
|
||||||
this.io = this.connect(connection, options);
|
this.io = this.connect(connection, options);
|
||||||
this.useConnectionNamespace = (options && options.useConnectionNamespace) || false;
|
this.useConnectionNamespace = (options && options.useConnectionNamespace);
|
||||||
|
this.namespaceName = (options && options.namespaceName);
|
||||||
this.emitter = new Emitter(vuex);
|
this.emitter = new Emitter(vuex);
|
||||||
this.listener = new Listener(this.io, this.emitter);
|
this.listener = new Listener(this.io, this.emitter);
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ export default class VueSocketIO {
|
||||||
*/
|
*/
|
||||||
install(Vue){
|
install(Vue){
|
||||||
|
|
||||||
const namespace = this.io.nsp.replace("/", "");
|
const namespace = this.namespaceName || this.io.nsp.replace("/", "");
|
||||||
|
|
||||||
if (this.useConnectionNamespace) {
|
if (this.useConnectionNamespace) {
|
||||||
if (typeof Vue.prototype.$socket === "object") {
|
if (typeof Vue.prototype.$socket === "object") {
|
||||||
|
|
Loading…
Add table
Reference in a new issue