refactor(sockets): Bootstrap buttons

parent 9739e214
<template> <template>
<div> <div>
<b-button-group class="mt-lg-3">
<b-button @click="pingServer()" variant="warning" size="sm">Ping Server</b-button>
<b-button @click="logOn()" variant="success" size="lg">LogOn</b-button>
<b-button @click="logOff()" size="lg">LogOff</b-button>
</b-button-group>
<p v-if="isConnected">We're connected to the server!</p> <p v-if="isConnected">We're connected to the server!</p>
<p v-if="!isConnected">We're not connected yet...</p> <p v-if="!isConnected">We're not connected yet...</p>
...@@ -11,20 +16,16 @@ ...@@ -11,20 +16,16 @@
</li> </li>
</ul> </ul>
</div> </div>
<button @click="pingServer()">Ping Server</button>
<button @click="logOn()">LogOn</button>
<button @click="logOff()">LogOff</button>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
isConnected: false, isConnected: false,
socketMessages: [] socketMessages: []
} };
}, },
sockets: { sockets: {
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
} }
}, },
sendMessage(message) { sendMessage(message) {
this.$socket.emit('pingServer', message); this.$socket.emit("pingServer", message);
console.log("Message sent:", message); console.log("Message sent:", message);
}, },
...@@ -66,5 +67,5 @@ ...@@ -66,5 +67,5 @@
this.socketMessage = []; this.socketMessage = [];
} }
} }
} };
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment