forked from jiawei380106/iframe-list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
37 lines (37 loc) · 796 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
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(video) {
console.log("Deleting video");
this.videos.splice(video, 1);
}
}
});