-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
58 lines (55 loc) · 1.4 KB
/
app.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
new Vue({
el:'#vue-app',
data:{
age:30,
a:0,
b:0,
x:0,
y:0,
available:false,nearby:false,
error:false,success:false,
name:'shaun',
job:'ninja',
website:'https://thenetninja.co.uk',
websitetag:"<a href="https://thenetninja.co.uk"></a>",
},
methods:{
greet:function(time){
return 'good '+time+' ' +this.name;
}
add:function(inc){
this.age+=inc;
}
sub:function(inc1){
this.age-=inc1;
}
updateXY:function(event){
this.x=event.offsetX;
this.y=event.offsetY;
}
// addtoA():function(){
// console.log("add to a");
// return this.a+this.age;
// }
// addtoB():function(){
// console.log("add to b");
// return this.b+this.age;
// }
},
computed:{
addtoA():function(){
console.log("add to a");
return this.a+this.age;
}
addtoB():function(){
console.log("add to b");
return this.b+this.age;
}
compClasses:function(){
return {
nearby:this.nearby,
available:this.available,
}
}
}
});