标签:val tps family bsp ret work http name XML
github地址:https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxs/
js:
Page({
data: {
array: [1, 2, 3, 4, 5, 1, 2, 3, 4]
}
})
wxml:
<view> {{m1.getMax(array)}} </view>
<wxs module="m1">
var getMax = function(array) {
var max = undefined;
for (var i = 0; i < array.length; ++i) {
max = max === undefined ?
array[i] :
(max >= array[i] ? max : array[i]);
}
return max;
}
module.exports.getMax = getMax;
</wxs>
标签:val tps family bsp ret work http name XML
原文地址:https://www.cnblogs.com/mcll/p/11772478.html