标签:round NPU 案例 计算 vue ack fir inpu mode
1、案例1
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>计算属性</title> </head> <body> <div id="app"> <!--fullName的值需要根据firstName和lastName的值拼接而成--> firstName:<input type="text" v-model="firstName"></input><br> lastName:<input type="text" v-model="lastName"></input><br> fullName:<input type="text" v-model="fullName"></input> </div> <script src="../js/vue.js" type="text/javascript"></script> <script> const vm = new Vue({ el: "#app", data: { firstName: "A", lastName: "B" }, computed: { //计算属性的方法会在初始化属性值以及和属性值相关的数据有改变的时候被执行 //当firstName和lastName任何一个有改变时都会重新计算fullName的值 fullName() { return this.firstName + " " + this.lastName; } } }); </script> </body> </html>
标签:round NPU 案例 计算 vue ack fir inpu mode
原文地址:https://www.cnblogs.com/liuyang-520/p/12444087.html