Add some vue books/docs.
This commit is contained in:
31
vue/chapter2.html
Normal file
31
vue/chapter2.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<html>
|
||||
<head>
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
|
||||
<title>Greetings friend</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h2>Hello {{name}}</h2>
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label for="name">Enter your name:</label>
|
||||
<!-- binded input to 'name' -->
|
||||
<input v-model="name" type="text" class="form-control" id="name" placeholder="Name">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- displays all data within Vue instance filtered through JSON -->
|
||||
<pre>{{ $data | json }}</pre>
|
||||
</body>
|
||||
<!-- cdn that contains all contents of Vue.js -->
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.js"></script>
|
||||
<script type="text/javascript">
|
||||
new Vue({
|
||||
el: 'body',
|
||||
data: {
|
||||
//empty variable each binded to input
|
||||
name: "",
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</html>
|
Reference in New Issue
Block a user