Skip to content

Commit 254dd04

Browse files
author
mykkip
committed
vue refs
1 parent 1486a06 commit 254dd04

File tree

5 files changed

+10227
-0
lines changed

5 files changed

+10227
-0
lines changed

15 -- Vue - Refs/css/style.css

+6
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+
}

15 -- Vue - Refs/img/logo.png

6.69 KB
Loading

15 -- Vue - Refs/index.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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">
10+
<h2>Refs</h2>
11+
<input type="text" ref="input">
12+
<button @click="readRefs"> Submit </button>
13+
14+
<p>Your Fav Food: {{output}}</p>
15+
16+
<div ref='test'>
17+
hello
18+
</div>
19+
20+
</div>
21+
22+
<script src="js/main.js"></script>
23+
</body>
24+
</html>

15 -- Vue - Refs/js/main.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
var vm = new Vue({
2+
3+
el: "#vue-app",
4+
data:{
5+
output: 'Your Fav Food',
6+
},
7+
methods:{
8+
readRefs: function(){
9+
console.log(this.$refs.innerText);
10+
this.output = this.$refs.input.value
11+
}
12+
}
13+
14+
});

0 commit comments

Comments
 (0)