index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div id="app">
{{ message }}
</div>
<script src="<https://unpkg.com/vue>"></script>
<script src="app.js"></script>
</body>
</html>
app.js
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
index.html
<div id="app">
{{ message }}
</div>
app.js
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
index.html
<div id="app-2">
<span v-bind:title="message">
Hover your mouse over me for a few seconds
to see my dynamically bound title!
</span>
</div>
app.js
var app2 = new Vue({
el: '#app-2',
data: {
message: 'You loaded this page on ' + new Date().toLocaleString()
}
})
index.html