全部 前端333笔记222游戏服务器搭建222css111vue111typescript111C语言111web服务器111后端111v3-瀑布流组件封装 2025-03-11 10:41:41记录一下封装的瀑布流组件 ``` <template> <div class="relative" ref="containerRef" :style="{ height: `${contentHeight}px` }"> <div class="item absolute top-0 left-0 transform" v-for="item, index in props.list" :key="index" :style="{ width: `${columnWidth}px` }" > <slot name063vue3瀑布流前端v3自定义指令-图片懒加载 2025-03-11 10:38:14封装代码: ``` export const useImgLazyLoad = () => { // v-lazy 指令 const vLazy = { // 元素加载完成时 mounted mounted: (el: HTMLImageElement) => { el.src = 'https://i.gifer.com/ZKZg.gif' // 加载占位符 el.addEventListener('error', () => { el.src = 'https://img.ixintu.com/download/jpg/202058vue3图片懒加载前端Day.js的基本用法 2024-06-06 09:25:08Day.js 设计为链式调用风格,每次调用dayjs的方法都会返回一个dayjs对象。 #### 1. 解析时间 1. 获取当前时间:dayjs() 2. 解析 [ISO 8601(opens new window)](https://en.wikipedia.org/wiki/ISO_8601)格式的字符串:dayjs('2018-04-04T16:00:00.000Z') 3. 解析毫秒级时间戳:dayjs(1318781876406) 4. 解析秒级时间戳:dayjs.unix(1318781876),支持带小数点 5. 时间校验(不严格,只检查该事件能否被dayjs解析,不判断是否0271dayjs时间处理前端 / 1鲁ICP备2020040502号-2