// 随机数
const fun = () => {
nextTick(() => {
let arr = [];
for (let i = 0; i < 18; i++) {
let s = Math.round(Math.random() * 1000) / 10;
arr.push(s);
console.log(s);
}
});
};
onMounted(() => {
fun();
data.Time = setInterval(() => {
fun();
}, 5000);
});
onBeforeUnmount(() => {
clearInterval(data.Time);
data.Time = null;
});
vue3 定时刷新随机数
最新推荐文章于 2024-02-25 20:24:03 发布