File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
new Vue ( {
2
2
el : '#vue-app' ,
3
3
data : {
4
-
4
+ name : '' ,
5
+ age : ''
5
6
} ,
6
7
methods : {
7
8
logName : function ( ) {
Original file line number Diff line number Diff line change 10
10
< div id ="vue-app ">
11
11
< h1 > Keyboard Events</ h1 >
12
12
< label > Name:</ label >
13
- < input type ="text " v-on:keyup.enter ="logName " />
13
+ < input type ="text " v-on:keyup.enter ="logName " v-model ="name " />
14
+ < span > {{ name }}</ span >
14
15
< label > Age:</ label >
15
- < input type ="text " v-on:keyup.alt.enter ="logAge " />
16
+ < input type ="text " v-on:keyup.alt.enter ="logAge " v-model ="age " />
17
+ < span > {{ age }}</ span >
16
18
</ div >
17
19
</ body >
18
20
Original file line number Diff line number Diff line change 1
- # canvas {
2
- width : 600px ;
3
- padding : 200px 20px ;
4
- text-align : center;
5
- border : 1px solid # 333 ;
1
+ label {
2
+ display : block;
3
+ margin : 20px 0 10px
6
4
}
You can’t perform that action at this time.
0 commit comments