!UBDDL
+BWB%PͰ͠ΐ͏
KBWBEP
mounted() {
this.ws = new WebSocket('wss://tacck-ws.herokuapp.com/')
const self = this
this.ws.addEventListener('message', message => {
const obj = JSON.parse(message.data)
const type = obj.message
const data = obj.data
if (type === 'selections') {
self.selections = data
}
})
},
methods: {
send(id) {
this.ws.send(JSON.stringify(
{
message: 'post',
data: {
id: id
}
}
))
}
}