昨天把组件库 iView Weapp研究了一下,里面确实有很多不错的组件,对于组件的使用,也写了一下笔记:五分钟上手-微信小程序组件库 iView Weapp
https://cloud.tencent.com/developer/article/1448408
今天用小程序iView Weapp实现一个倒计时。具体可参考文档。
wxml
<view class="view-wrap">
<text class="type-title">倒计时:</text>
<i-count-down
target="{{targetTime}}"
clear-timer="{{clearTimer}}"
></i-count-down>
</view>
js
Page({
data: {
clearTimer: false
},
onLoad() {
this.setData({
targetTime: new Date().getTime() + 6430000,
});
},
onUnload() {
this.setData({
clearTimer: true
});
},
myLinsterner(e) {
this.setData({
});
}
});
json
{
"usingComponents": {
"i-count-down": "../../dist/count-down/index",
"i-card": "../../dist/card/index"
}
}
效果如下所示
原文作者:祈澈姑娘 技术博客:https://www.jianshu.com/u/05f416aefbe1
90后前端妹子,爱编程,爱运营,文艺与代码齐飞,魅力与智慧共存的程序媛一枚。
坚持总结工作中遇到的技术问题,坚持记录工作中所所思所见,
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有