返回二个整数相加计......登陆

二个整数相加计算器

天腾²⁰¹⁹2019-05-19 18:00:06196
<!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>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送