File tree 2 files changed +64
-0
lines changed
2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ < html >
2
+ < head >
3
+ < script src ="vue.js "> </ script >
4
+ </ head >
5
+
6
+ < body >
7
+
8
+ < div id ="my-app ">
9
+
10
+ < input type ="text " v-model ="maths " placeholder ="Maths marks ">
11
+ < input type ="text " v-model ="science " placeholder ="Science marks ">
12
+ < input type ="text " v-model ="english " placeholder ="English marks ">
13
+
14
+ < h3 > Total Marks: {{ totalSubjectMarks }}</ h3 >
15
+
16
+
17
+ {{ runme() }}
18
+
19
+ < br /> < br />
20
+
21
+ < input type ="text " v-model ="meter " placeholder ="Enter length in meter ">
22
+
23
+ < h4 > Length in cm : {{ convertToCentimeter }}</ h4 >
24
+
25
+ < br />
26
+ < br />
27
+ < input type ="text " placeholder ="Enter First Name " v-model ="firstname ">
28
+ < input type ="text " placeholder ="Enter Last Name " v-model ="lastname ">
29
+
30
+ < h4 > Full name: {{ getFullName }}</ h4 >
31
+
32
+ </ div >
33
+
34
+ < script src ="video-11.js "> </ script >
35
+ </ body >
36
+ </ html >
Original file line number Diff line number Diff line change
1
+ var myapp = new Vue ( {
2
+ el :"#my-app" ,
3
+ data :{
4
+ firstname : "" ,
5
+ lastname : "" ,
6
+ meter :"" ,
7
+ maths :0 ,
8
+ science : 0 ,
9
+ english : 0
10
+ } ,
11
+ methods :{
12
+ runme : function ( ) {
13
+ console . log ( "This is first method" ) ;
14
+ return "I am method"
15
+ }
16
+ } ,
17
+ computed :{
18
+ getFullName : function ( ) {
19
+ return this . firstname + " " + this . lastname ;
20
+ } ,
21
+ convertToCentimeter : function ( ) {
22
+ return this . meter * 100 ; // 1m = 100cm
23
+ } ,
24
+ totalSubjectMarks : function ( ) {
25
+ return parseInt ( this . maths ) + parseInt ( this . english ) + parseInt ( this . science ) ;
26
+ }
27
+ }
28
+ } ) ;
You can’t perform that action at this time.
0 commit comments