摘要:<html> <head> <meta charset="utf-8"> <title&
<html> <head> <meta charset="utf-8"> <title>偵聽(tīng)器</title> <script type="text/javascript" src="vue.js"></script> </head> <body> <div id="box"> 請(qǐng)輸入數(shù)字1 <input type="text" v-model="num1"> 請(qǐng)輸入數(shù)字2 <input type="text" v-model="num2"> <h2>兩數(shù)相加結(jié)果為:{{sum}}</h2> </div> <script type="text/javascript"> new Vue({ el:"#box", data:{ num1:"", num2:"" }, computed:{ sum:function(){ return parseInt(this.num1)+parseInt(this.num2); } } }) </script> </body> </html>
批改老師:查無(wú)此人批改時(shí)間:2019-05-05 09:19:47
老師總結(jié):看到你的作業(yè)挺多,學(xué)習(xí)編程需要有耐心,堅(jiān)持。繼續(xù)加油