全部 前端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 name059vue3瀑布流前端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/202056vue3图片懒加载前端nginx常用指令(启动、停止、重新加载配置) 2024-12-19 16:04:58#### 1. nginx启动 > start nginx > nginx (在当前窗口运行,关闭窗口后自动结束) #### 2. nginx的停止 > nginx -s stop(强制停止) > > nginx -s quit (处理完请求再停止) #### 3. nginx重新加载配置 > nginx -s reload #### 4. nginx检查配置是否正确 > nginx -t1142nginxweb服务器解决TypeScript项目打包后路径别名失效问题 2024-07-08 15:25:45### 解决TypeScript项目打包后路径别名失效问题 在TypeScript项目开发过程中,利用`tsconfig.json`中的`paths`配置别名可以极大地提升代码的可读性和维护性。然而,在项目打包并使用Node.js直接运行编译后的JavaScript代码时,这些路径别名往往无法被正确解析,导致“找不到模块”之类的错误。本文将针对这一常见问题,介绍几种有效的解决方案,确保你的项目从开发到部署都能平滑运行。 #### 问题背景 当你在TypeScript项目中定义了如下的`tsconfig.json`配置: ``` 1{ 2 "compilerOptions": { 3 0537tspathstypescriptDay.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解析,不判断是否0268dayjs时间处理前端 / 3鲁ICP备2020040502号-2