upload project
This commit is contained in:
commit
06961cae04
422 changed files with 110626 additions and 0 deletions
19
pages/circle/circle.wxs
Normal file
19
pages/circle/circle.wxs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// 截取数组的前n个元素
|
||||
function slice(array, count) {
|
||||
if (!array) {
|
||||
return [];
|
||||
}
|
||||
var len = array.length;
|
||||
if (len === 0) {
|
||||
return [];
|
||||
}
|
||||
var num = parseInt(count) || 5;
|
||||
if (num <= 0) {
|
||||
num = 5;
|
||||
}
|
||||
return array.slice(0, num > len ? len : num);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
slice: slice
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue