二个整数相加计算器

Original 2019-05-19 18:00:06 196
abstract:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>二个整数相加计算器</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
<style>
#box{width: 160px;height: 200px;border: 5px solid gray;border-radius: 10px;margin: 50px;background: #ccc;}
input{width: 60px;height: 20px;margin: 20px 10px;}
i{color:green;font-size: 20px;}
</style>


</head>
<body>

<div id="box">
<div >
整数:<input type="text" v-model.number="x">
</div>
相加:<span>+</span>
<div>
整数:<input type="text" v-model.number="y">
</div>
<div><b>合计=</b><i>{{total}}</i></div>
</div>



<script>
new Vue({
//设置挂载点
el: '#box',
data: {
x: '',
y: '',
},

computed: {
total: function () {
return (this.x + this.y);
}
}
})
</script>
</body>
</html>


Correcting teacher:查无此人Correction time:2019-05-20 09:23:57
Teacher's summary:完成的不错。前端模版比较多,要多了解一些。对工作有帮助。继续加油。

Release Notes

Popular Entries