File tree 5 files changed +10242
-0
lines changed
14 -- Vue - Intro to Components
5 files changed +10242
-0
lines changed Original file line number Diff line number Diff line change
1
+ body {
2
+ text-align : center;
3
+ }
4
+ p {
5
+ text-transform : capitalize;
6
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < title > Vue Tutorials</ title >
5
+ < link rel ="stylesheet " type ="text/css " href ="css/style.css ">
6
+ < script src ="js/vue.js "> </ script >
7
+ </ head >
8
+ < body >
9
+ < div id ="vue-app-one ">
10
+ < h2 > 1< sup > st</ sup > Components with Vue JS</ h2 >
11
+
12
+ < greeting > </ greeting >
13
+ </ div >
14
+
15
+ < div id ="vue-app-two ">
16
+ < h2 > 2< sup > nd</ sup > Component</ h2 >
17
+ < greeting > </ greeting >
18
+ </ div >
19
+
20
+ < script src ="js/main.js "> </ script >
21
+ </ body >
22
+ </ html >
Original file line number Diff line number Diff line change
1
+ Vue . component ( 'greeting' , {
2
+
3
+ template :'<p>Hey there? this is a reusable {{name}} . <button @click="changeName">Change Name</button></p>' ,
4
+ data : function ( ) {
5
+ return {
6
+ name : 'mie'
7
+ }
8
+ } ,
9
+
10
+ methods :{
11
+
12
+ changeName : function ( ) {
13
+ this . name = 'messa'
14
+ }
15
+ }
16
+
17
+ } ) ;
18
+
19
+
20
+ var vm = new Vue ( {
21
+
22
+ el : "#vue-app-one"
23
+
24
+ } ) ;
25
+
26
+
27
+ var vm = new Vue ( {
28
+
29
+ el : "#vue-app-two"
30
+
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments