File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ new Vue({
15
15
updateXY : function ( event ) {
16
16
this . x = event . offsetX ;
17
17
this . y = event . offsetY ;
18
+ } ,
19
+ click : function ( ) {
20
+ alert ( 'you clicked me' ) ;
18
21
}
19
22
}
20
23
} ) ;
Original file line number Diff line number Diff line change 9
9
< body >
10
10
< div id ="vue-app ">
11
11
< h1 > Events</ h1 >
12
- < button v-on:click ="add(1) "> Add a Year</ button >
12
+ < button v-on:click.once ="add(1) "> Add a Year</ button >
13
13
< button v-on:click ="subtract(1) "> Subtract a Year</ button >
14
14
< button v-on:dblclick ="add(10) "> Add 10 Years</ button >
15
15
< button v-on:dblclick ="subtract(10) "> Subtract 10 Years</ button >
16
16
< p > My age is {{age}}</ p >
17
- < div id ="canvas " v-on:mousemove ="updateXY "> {{ x }} , {{ y }}</ div >
17
+ < div id ="canvas " v-on:mousemove.capture ="updateXY "> {{ x }} , {{ y }}</ div >
18
+ < p > < a v-on:click.prevent ="click " href ="http://www.thenetninja.co.uk "> The Net Ninja</ a > </ p >
18
19
</ div >
19
20
</ body >
20
21
You can’t perform that action at this time.
0 commit comments