![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
封装工具
YY小怪兽
干饭了 干饭了
展开
-
3-vue播放进度条
template <div class="progress-bar" ref="progressBar" @click="progressClick"> <div class="progress-line" ref="progressLine"> <div class="progress-dot"></div> </div> </div>SCSS .progre原创 2022-03-17 10:25:48 · 1392 阅读 · 0 评论 -
2-JS格式化时间
格式化时间传入(秒数)如果传入的不是秒数则需要修改一下代码比如传入的是ms 则需要 let differSecond = time*1000转化为秒数export const formatTime = (time) => { // 2.得到两个时间之间的差值(秒) let differSecond = time // 3.利用相差的总秒数 / 每一天的秒数 = 相差的天数 let day = Math.floor(differSecond / (60 * 60 * 24))原创 2022-03-17 10:07:39 · 441 阅读 · 0 评论 -
1-JS获得规定范围的随机数
//获得随机数传入(最小值,最大值)export const getRandomIntInclusive = (min, max) => { min = Math.ceil(min) max = Math.floor(max) return Math.floor(Math.random() * (max - min + 1)) + min // 含最大值,含最小值}原创 2022-03-17 10:03:41 · 248 阅读 · 0 评论