-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy patheventos.html
60 lines (56 loc) · 1.48 KB
/
eventos.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>VUEjs V2 Eventos | Rimorsoft Online</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div id="main">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>Eventos en VUEjs</h2>
</div>
<div class="col-xs-4">
<form v-on:submit.prevent="addName">
<div class="input-group">
<input type="text" class="form-control" v-model="name">
<span class="input-group-btn">
<input type="submit" class="btn btn-default" value="add">
</span>
</div>
</form>
<hr>
<ul class="list-group">
<li class="list-group-item" v-for="item in people" v-text="item"></li>
</ul>
</div>
<div class="col-xs-4">
<button v-on:click="num += 1">
{{ num }} <i class="glyphicon glyphicon-thumbs-up"></i>
</button>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.0/vue.js"></script>
<script type="text/javascript">
new Vue({
el: '#main',
data: {
people: ['Lynda', 'Isabella', 'Abel', 'Diana'],
name: '',
num: 0,
},
methods: {
addName: function (){
this.people.unshift(this.name);
this.people.push(this.name);
this.name = '';
}
}
});
</script>
</body>
</html>