vue/examples/firebase/index.html

36 lines
1.2 KiB
HTML
Raw Normal View History

2016-04-16 04:20:35 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>Vue.js firebase + validation example</title>
2016-04-16 04:20:35 +08:00
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<!-- Vue -->
<!-- Delete ".min" for console warnings in development -->
<script src="../../dist/vue.min.js"></script>
2016-04-16 04:20:35 +08:00
<!-- Firebase -->
2016-09-19 23:14:19 +08:00
<script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script>
2016-04-16 04:20:35 +08:00
<!-- VueFire -->
2016-09-19 23:14:19 +08:00
<script src="https://unpkg.com/vuefire@1.3.0"></script>
2016-04-16 04:20:35 +08:00
</head>
<body>
<div id="app">
<ul is="transition-group">
<li v-for="user in users" class="user" :key="user['.key']">
<span>{{user.name}} - {{user.email}}</span>
<button v-on:click="removeUser(user)">X</button>
</li>
2016-04-16 04:20:35 +08:00
</ul>
<form id="form" v-on:submit.prevent="addUser">
<input v-model="newUser.name" placeholder="Add Name">
<input v-model="newUser.email" placeholder="Add Email">
2016-04-16 04:20:35 +08:00
<input type="submit" value="Add User">
</form>
<ul class="errors">
<li v-show="!validation.name">Name cannot be empty.</li>
<li v-show="!validation.email">Please provide a valid email address.</li>
</ul>
</div>
<script src="app.js"></script>
</body>
</html>