Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It dosn't work well when I use vue2.0( I develop the server end with nodejs) #10

Closed
Zenfeder opened this issue Oct 26, 2016 · 2 comments

Comments

@Zenfeder
Copy link

SOS!!! The server-end can receive the event emitted by client-end, but the client-end can't receive the event from server-end. I show my code as below:

// client.vue (client-end)
<template>
   ...
</template>

<script>
export default {
    sockets: {
        connect: function () {
            console.log('socket connected');  //  This cmd dosn't works
        },
        serverEmit: function (msg) {
            console.log("Message:"+msg);  //  This cmd dosn't works
        }
    },
    methods: {
        trigger () {
            this.$socket.emit('clientEmit', "I'm a message from client."); //  This cmd works well
        }
    }
}
</script>
// server.js(server-end)
io.on('connection', (socket) => {
        console.log('Socket connect successful.'); //  This cmd works well

        socket.on('clientEmit', (msg) => {
            console.log("Message: " + msg);

            socket.emit('serverEmit', "I'm a message from server."); //  This cmd works well
        });
    });

I think the option 'sockets' is not useful in vue2.0 anymore.

@MetinSeylan
Copy link
Owner

vue 2.0 support not yet :(

@MetinSeylan
Copy link
Owner

published 2.0.0 7f5fac2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants