MOBILISIS-Calculator/vue/chapter2.html

31 lines
942 B
HTML

<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>