1 Star 0 Fork 0

xiaohu123 / Vue-Learning

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Lesson2-instance.html 535 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaohu123 提交于 2021-03-24 16:31 . commit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>instance</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app1">
<p>{{a}}</p>
</div>
</body>
<script type="text/javascript">
var data = {a:1}
//Object.freeze(data)
var vm = new Vue({
el:'#app1',
data:data
})
vm.$watch('a',function(newValue,oldValue){
console.log("a的值被改变了");
console.log(newValue,oldValue);
})
</script>
</html>
1
https://gitee.com/xiaohufight/vue-learning.git
git@gitee.com:xiaohufight/vue-learning.git
xiaohufight
vue-learning
Vue-Learning
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891