5分钟学会基本用法:
https://www.jianshu.com/p/1a28d921751f
入门:
https://www.jianshu.com/p/bb0892e07d6f
官网:
https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxs/
自己写的练手的,xx秒转00:00的格式
<wxs module="a">
var change = function(s) {
var m = Math.floor(s/60);
var s = s%60;
//将变量转换为字符串
m+='';
s+='';
//如果只有一位数,前面增加一个0
m = (m.length==1)?'0'+m:m;
s = (s.length==1)?'0'+s:s;
return m+':'+s;
}
module.exports.change = change
</wxs>
<view class="msg2" >{{a.change(counting)}}</view>