Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2995 from anhtudo97/patch-2
Browse files Browse the repository at this point in the history
Merged by aniket965
  • Loading branch information
Aniket965 committed Oct 15, 2018
2 parents eee1f0b + 194b0f9 commit 63be2e3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions VueJS/WatchVueJs
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>

<body>
<div id="app">
{{ diem }}
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script>
var app = new Vue({
el: "#app",
data: {
diem: "Result of A is 7",
},
watch: {
diem: function (newValue) {
console.log("The result of A is change!")
}
},
});

app.diem = 'Result of A is 8';
</script>
</body>
</html>

0 comments on commit 63be2e3

Please sign in to comment.