-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
103 lines (92 loc) · 2.88 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vue-poll Example</title>
<meta name="description" content="A vue-poll example">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<style>
body{
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.cnt, .logo-cnt{
margin: 0 auto;
max-width: 500px;
}
.logo-cnt{
border-bottom: 1px solid #2c3e50;
margin-bottom: 40px;
}
h1{
text-align: center;
font-size: 35px;
margin: 10px 0 40px;
color: #2c3e50;
}
.logo{
display: block;
margin: 0 auto;
}
@media screen and (max-width:767px){
.logo{
max-width: 100px
}
}
.links-cnt{
text-align: center;
margin-top: 40px;
}
.links-cnt .link{
color: #2c3e50;
text-decoration: none;
}
</style>
</head>
<body>
<div id="app">
<div class="logo-cnt">
<img src="logo.png" class="logo" alt="vue-logo"/>
<h1>Vue-poll Example</h1>
</div>
<div class="cnt">
<vue-poll v-bind="options" @addvote="addVote"/>
</div>
<div class="links-cnt">
<a href="https://github.com/ppietris/vue-poll" target="_blank" class="link fab fa-github fa-2x"></a>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
<script src="https://unpkg.com/vue-poll/dist/vue-poll.min.js"></script>
<script>
Vue.use(VuePoll)
new Vue({
el: '#app',
data: function(){
return {
options: {
question: 'What\'s your favourite <strong>JS</strong> framework?',
answers: [
{ value: 1, text: 'Vue', votes: 53 },
{ value: 2, text: 'React', votes: 35 },
{ value: 3, text: 'Angular', votes: 30 },
{ value: 4, text: 'Other', votes: 10 }
],
finalResults: false,
showResults: false,
multiple: false,
customId: 1
}
}
},
methods: {
addVote: function(obj){
console.log('You voted ' + obj.value + '!');
}
}
})
</script>
</body>
</html>