-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
38 lines (37 loc) · 789 Bytes
/
main.js
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
var app = new Vue({
el: "#app",
data: {
showMessage: false,
showChorus: false,
message: "Greetings",
newTitle: "",
newUrl: "",
videos: [
{
show: true,
title: "Happier",
url: "https://www.youtube.com/embed/iWZmdoY1aTE"
},
{
show: false,
title: "Happier - Chorus no controls",
url: "https://www.youtube.com/embed/iWZmdoY1aTE?controls=0&start=55"
}
]
},
methods: {
addVideo: function() {
console.log("Adding video");
var obj = {
show: true,
title: this.newTitle,
url: this.newUrl
};
this.videos.push(obj);
},
deleteVideo: function(n) {
console.log("Deleting video");
this.videos.splice(n, 1);
}
}
});