commit | 070005a28c5acc53a30da3a77ff0ff542497c4ff | [log] [tgz] |
---|---|---|
author | guangchao.xu <guangchao.xu@supwisdom.com> | 周一 12月 07 09:56:40 2020 +0800 |
committer | guangchao.xu <guangchao.xu@supwisdom.com> | 周一 12月 07 09:56:40 2020 +0800 |
tree | 940554ee4a1b12c26bc2694586a7d80c42d9cc37 | |
parent | 5653eca0850571e2f03479bbb17ec056ce0770a9 [diff] [blame] |
更新大理市民卡app
diff --git a/uview-ui/libs/function/randomArray.js b/uview-ui/libs/function/randomArray.js new file mode 100644 index 0000000..590a048 --- /dev/null +++ b/uview-ui/libs/function/randomArray.js
@@ -0,0 +1,7 @@ +// 打乱数组 +function randomArray(array = []) { + // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0 + return array.sort(() => Math.random() - 0.5); +} + +export default randomArray