<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>数据如何双向绑定</title>
</head>
<body>
<div id="app">
<h2>图书</h2>
<div>
您购买了{{book.name}}共{{book.count}}本=== ¥{{book.price}}/本
</div>
<div>
总价:{{book.price * book.count}}
</div>
</div>
<script src="../js/vue.js"></script>
<script>
let vm = new Vue({
el:'#app',
data:{
book:{id:1,price:10,name:'vue入门',count:1}
}
});
</script>
</body>
</html>
vue-例2-6计算属性.html
最新推荐文章于 2024-08-28 14:58:40 发布