|
|
@ -303,7 +303,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import Ruler from "@/components/ruler.vue";
|
|
|
|
import Ruler from "@/components/ruler.vue";
|
|
|
|
import {ref} from "vue";
|
|
|
|
import {onMounted, ref} from "vue";
|
|
|
|
|
|
|
|
|
|
|
|
const socketData = [
|
|
|
|
const socketData = [
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -466,10 +466,14 @@ const processData = (data) => {
|
|
|
|
|
|
|
|
|
|
|
|
processData(socketData[0])
|
|
|
|
processData(socketData[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
ad()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const ad = () => {
|
|
|
|
const ad = () => {
|
|
|
|
|
|
|
|
|
|
|
|
// 1. 创建 WebSocket 连接(ws:// 或 wss://)
|
|
|
|
// 1. 创建 WebSocket 连接(ws:// 或 wss://)
|
|
|
|
const socket = new WebSocket("ws://192.168.0.11:7789/ws");
|
|
|
|
const socket = new WebSocket("ws://192.168.1.123:7789/ws");
|
|
|
|
|
|
|
|
|
|
|
|
// 2. 连接成功时触发
|
|
|
|
// 2. 连接成功时触发
|
|
|
|
socket.addEventListener("open", () => {
|
|
|
|
socket.addEventListener("open", () => {
|
|
|
|