setTimeout(()=>{
var arr = ["https://vant-contrib.gitee.io/vant/#/zh-CN/","https://element.eleme.cn/#/zh-CN/component/installation"];
window.location.href = arr[parseInt(Math.random()*arr.length)];
},1000)
本文介绍如何使用JavaScript实现一个随机跳转功能,通过Math.random()函数随机选择Vant或Element UI的安装文档。适合初学者了解前端与后端开发组件的交互和导航。
setTimeout(()=>{
var arr = ["https://vant-contrib.gitee.io/vant/#/zh-CN/","https://element.eleme.cn/#/zh-CN/component/installation"];
window.location.href = arr[parseInt(Math.random()*arr.length)];
},1000)

被折叠的 条评论
为什么被折叠?