forked from zhenbianshu/websocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.html
37 lines (33 loc) · 1.17 KB
/
client.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat test page</title>
<link rel="stylesheet" type="text/css" href="css/looper_ui.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<h2 class="describe">实时聊天室实现</h2>
<div class="view" id="app">
<div class="chat_list">
<h4 class="your_id">Your id is:{{ user_id }}</h4>
<h4 class="your_id">当前在线:{{ user_num }}人</h4>
<h4 v-for="user in user_list" class="your_id">{{ user }}</h4>
</div>
<div class="history">
<div class="history_box">
<p v-for="item in hist" class="msg other_msg">{{item}}<br></p>
</div>
<div class="msg_box">
<input type="text" name="" v-model="message" class="text_input" @keyup.13="send_my_msg" placeholder="请输入内容……"></div>
<button class="send_btn" v-on:click="send_my_msg">发送(Enter)</button>
</div>
</div>
</body>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/axios.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<style type="text/css">
</style>
</html>