From 4f119adb9ee71abb590160a894a0395835f44ba9 Mon Sep 17 00:00:00 2001 From: hxr <1490493387@qq.com> Date: Tue, 14 May 2024 07:40:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20sockjs-client=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20`global=20is=20not=20defined`=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E6=97=A0=E6=B3=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=20WebSocket=20=E9=A1=B5=E9=9D=A2=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closed https://github.com/sockjs/sockjs-client/issues/565 --- src/typings/socket.d.ts | 6 + src/views/demo/websocket.vue | 229 ++++++++++++++++++----------------- 2 files changed, 121 insertions(+), 114 deletions(-) create mode 100644 src/typings/socket.d.ts diff --git a/src/typings/socket.d.ts b/src/typings/socket.d.ts new file mode 100644 index 00000000..15a8ed78 --- /dev/null +++ b/src/typings/socket.d.ts @@ -0,0 +1,6 @@ +// https://github.com/sockjs/sockjs-client/issues/565 + +declare module "sockjs-client/dist/sockjs.min.js" { + import Client from "sockjs-client"; + export default Client; +} diff --git a/src/views/demo/websocket.vue b/src/views/demo/websocket.vue index ab1202e4..74eb67ba 100644 --- a/src/views/demo/websocket.vue +++ b/src/views/demo/websocket.vue @@ -1,117 +1,3 @@ - - - + + +