Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
de967a01
authored
Apr 30, 2024
by
AhJindeg
Committed by
Gitee
Apr 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update src/views/infra/webSocket/index.vue. #434
Signed-off-by: AhJindeg <ahjindeg@gmail.com>
parent
730da857
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
+2
-1
src/views/infra/webSocket/index.vue
+2
-1
No files found.
src/views/infra/webSocket/index.vue
View file @
de967a01
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</
template
>
</
template
>
<div
class=
"max-h-80 overflow-auto"
>
<div
class=
"max-h-80 overflow-auto"
>
<ul>
<ul>
<li
v-for=
"msg in message
List.reverse()
"
:key=
"msg.time"
class=
"mt-2"
>
<li
v-for=
"msg in message
ReverseList
"
:key=
"msg.time"
class=
"mt-2"
>
<div
class=
"flex items-center"
>
<div
class=
"flex items-center"
>
<span
class=
"text-primary mr-2 font-medium"
>
收到消息:
</span>
<span
class=
"text-primary mr-2 font-medium"
>
收到消息:
</span>
<span>
{{ formatDate(msg.time) }}
</span>
<span>
{{ formatDate(msg.time) }}
</span>
...
@@ -92,6 +92,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
...
@@ -92,6 +92,7 @@ const { status, data, send, close, open } = useWebSocket(server.value, {
/** 监听接收到的数据 */
/** 监听接收到的数据 */
const
messageList
=
ref
([]
as
{
time
:
number
;
text
:
string
}[])
// 消息列表
const
messageList
=
ref
([]
as
{
time
:
number
;
text
:
string
}[])
// 消息列表
const
messageReverseList
=
computed
(()
=>
messageList
.
value
.
slice
().
reverse
())
watchEffect
(()
=>
{
watchEffect
(()
=>
{
if
(
!
data
.
value
)
{
if
(
!
data
.
value
)
{
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment