返回 Vue 两数相...... 登陆

Vue 两数相加

幸福敲门 2019-08-06 15:15:46 695

<!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>

</head>


<body>

<div id="box">

<input type="text" v-model="ip1" />+

<input type="text" v-model="ip2" /><br>

<h3>{{zong}}</h3>

</div>


</body>

<script src="./js/vue.js"></script>

<script>

new Vue({

el: '#box',

data: {

ip1: '0',

ip2: '0',

},

computed:{

zong:function(){

return Number(this.ip1) + Number(this.ip2)

}

}

});

</script>


</html>


最新手记推荐

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

全部回复(0)我要回复

暂无评论~
  • 取消 回复 发送
  • PHP中文网