# randomArray 数组乱序

# 按需引入

如果未做全局扩展配置 (opens new window),可以按需引入:

// 引入
import { randomArray } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
// 调用
randomArray(...);

# randomArray(Array)

该函数可以打乱一维数组元素的顺序,这是随机过程:

  • array <Array> 一维数组
<script>
	export default {
		onLoad() {
			console.log(uni.$uv.randomArray([1,2,3,4,5,6,7,8,9]));
		}
	}
</script>