用微信小程序设计一个实现倒计时功能的小程序。
在index.wxml中,
<!--index.wxml-->
<view class='box' hidden='{
{hidden}}'>
<view class='title'>计时器</view>
<view class='time'>{
{num}}</view>
<view class='btnLayout'>
<button bindtap='start' disabled="{
{btnDisabled}}">开始计时</button>
<button bindtap='stop'>停止计时</button>
</view>
</view>
在index.wxss中,
/**index.wxss**/
.box
{
margin: 20rpx;
padding: 20rpx;
border: 1px solid silver;
}
.title
{
font-size: 25px;
text-align: center;
margin-bottom: 15px;
color: brown;
}
.time
{
width: 90%;
line-height: 200px;
background-color: darkgreen;
color:rgb(234, 233, 235);
font-size: 100px;
text-align: center;
border:1px soli