Skip to content

Commit 1486a06

Browse files
author
mykkip
committed
multiple vue instances
1 parent 8fd5b4b commit 1486a06

File tree

5 files changed

+10242
-0
lines changed

5 files changed

+10242
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
body{
2+
text-align: center;
3+
}
4+
p{
5+
text-transform: capitalize;
6+
}
6.69 KB
Loading
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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>
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
});

0 commit comments

Comments
 (0)