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({
/**
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)