2、pages加上
"pages/calc/calc",
3、 calc.wxml
<view class="container">
<input placeholder="被加数" bindinput="bindInput1" />
<input placeholder="加数" bindinput="bindInput2" />
<button type="primary" bindtap="bindAdd">计算</button>
<input placeholder="结果" value="{{result}}" disabled />
</view>
4、calc.wxss
/* pages/calc/calc.wxss */
.container{
justify-content: flex-start
padding: 30rpx 0
}
.container input{
background-color: #eee
border-radius:3px
text-align:left
width:720rpx
height:100rpx
line-height:100rpx
margin:20rpx
}
.container button{
width:80%
}
5、calc.json
{
"navigationBarBackgroundColor":"#00ff00",
"navigationBarTitleText":"加法计算器",
"navigationBarTextStyle":"white",
"usingComponents": {}
}
6、calc.js
// pages/calc/calc.js
Page({
/**
tabs数组对象下的值进行条件判断并修改属性值 isActive数组对象属性,v数组对象,i遍历下标
tabs.forEach((v,i)=>i===index?v.isActive=true:v.isActive=false)
collect数组对象下的值进行条件判断并修改属性值 goods_id数组对象属性,v数组对象,有一个满足的查询到了返回true
collect.some(v =>v.goods_id === this.GoodsInfo.goods_id)
//every必须每个都满足 否则是false
Array.every()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)