You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vue-Socket.io/example/index.html

67 lines
2.3 KiB
HTML

9 years ago
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vue-Socket.io</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div v-if="!join" id="join" class="text-center">
9 years ago
<form @submit.prevent="joinChat(name)">
<div class="form-group">
<input type="text" max="12" class="form-control input-lg text-center" v-model="name" placeholder="Name">
</div>
<button class="btn btn-primary btn-lg" type="submit">Join Chat</button>
</form>
9 years ago
</div>
<div v-if="join" id="group">
<div class="users">
<h4>Users</h4>
<ul class="list-unstyled">
<li v-for="user in users" track-by="$index">{{user}}</li>
</ul>
</div>
<div class="chat">
<div class="messages">
<ul class="list-unstyled">
9 years ago
<li v-for="m in messages" :class="{me: (m.name === name), clearfix: true}">
<div class="name">{{m.name}}</div>
<span>{{m.message}}</span>
</li>
9 years ago
</ul>
</div>
<div class="input">
<form @submit.prevent="send(message)">
<div class="input-group">
<input type="text" class="form-control" v-model="message" placeholder="uyudun mu?...">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">-></button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.22/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.6/socket.io.min.js"></script>
9 years ago
<script src="../vue-socketio.min.js"></script>
9 years ago
<script src="script.js"></script>
</body>
</html>