修改看板

IOT
夜笙歌 1 month ago
parent 9cbb59e25b
commit 61295cc850

@ -157,7 +157,7 @@ export default {
Chart Chart
}, },
mounted() { mounted() {
this.getData()
this.$refs.chart1.setData({ this.$refs.chart1.setData({
grid: { grid: {
top: 30, top: 30,
@ -369,7 +369,28 @@ export default {
] ]
}) })
}, },
methods: {} methods: {
getData(){
// WebSocket
const socket = new WebSocket('ws://192.168.2.165:7181/ws');
// WebSocket
socket.onopen = function(event) {
console.log('WebSocket 连接已打开');
};
//
socket.onmessage = function(event) {
console.log('收到消息:', event.data);
};
// WebSocket
socket.onclose = function(event) {
console.log('WebSocket 连接已关闭');
};
}
}
} }
</script> </script>
<style scoped> <style scoped>

Loading…
Cancel
Save