<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>响应式依赖</title>
</head>
<body>
<div id="app">
<input type="number" v-model="length">
<p>{{area}}</p>
</div>
<script src="../js/vue.js"></script>
<script>
let square = {
length:2
};
let vm = new Vue({
el:'#app',
data:square,
computed:{
area() {
return this.length * this.length * Math.random();
}
}
});
console.log(vm.area);
console.log(vm.area);
console.log(vm.area);
console.log(vm.area);
</script>
</body>
</html>
vue-前端第3章computed05.html
原创虾米大王 ©著作权
文章标签 vue.js javascript 前端 html Math 文章分类 JavaScript 前端开发

-
vue-前端第3章computed02.html
【代码】vue-前端第3章computed02.html。
javascript vue.js 前端 html Math -
vue-前端第3章computed06.html
【代码】vue-前端第3章computed06.html。
javascript vue.js 前端 html Math -
vue-前端第3章computed01.html
【代码】vue-前端第3章computed01.html。
vue.js javascript 前端 html Vue -
vue-前端第3章computed04.html
【代码】vue-前端第3章computed04.html。
vue.js javascript 前端 html 响应式 -
vue-前端第3章computed03.html
【代码】vue-前端第3章computed03.html。
vue.js javascript 前端 html Math -
vue-前端第3章watch05.html
【代码】vue-前端第3章watch05.html。
vue.js javascript 前端 html ci -
vue-前端第2章instance05.html
【代码】vue-前端第2章instance05.html。
vue.js javascript 前端 html ci -
vue-前端第6章form05.html
【代码】vue-前端第6章form05.html。
javascript 前端 dreamweaver python php -
vue-前端第4章class05.html
【代码】vue-前端第4章class05.html。
javascript vue.js 前端 html css -
vue-前端第12章transition05.html
【代码】vue-前端第12章transition05.html。
html javascript 前端 ide 开发技术 -
vue-前端第7章v-if05.html
【代码】vue-前端第7章v-if05.html。
vue.js javascript 前端 html Vue -
vue-前端第5章event05.html
【代码】vue-前端第5章event05.html。
vue.js javascript 前端 html Vue -
vue-前端第9章component05.html
【代码】vue-前端第9章component05.html。
vue.js javascript 前端 html Vue -
vue-前端第8章demoTwo05.html
【代码】vue-前端第8章demoTwo05.html。
vue.js sed ico html -
vue-案例教程第3章05.html
【代码】vue-案例教程第3章05.html。
javascript 前端 vue.js html -
vue-前端第11章ajax-demo05.html
【代码】vue-前端第11章ajax-demo05.html。
javascript 前端 html ios ajax -
vue-前端第3章watch04.html
【代码】vue-前端第3章watch04.html。
vue.js javascript 前端 html ci -
vue-前端第3章watch02.html
【代码】vue-前端第3章watch02.html。
vue.js javascript 前端 html ci -
vue-前端第3章watch12.html
【代码】vue-前端第3章watch12.html。
vue.js javascript 前端 html Vue