你瞅啥呢

10 2024 档案

摘要:2024-10-29 使用dayjs获取周一时间不正确dayjs获取周一代码为: dayjs().startOf('week').format('YYYY-MM-DD') 但是为什么获取到的周一日期为27呢? 原因:startOf('week')默认认为周日是一周开始的第一天,而不是周一才是第一天 嗯.......国外第一天都是周日吗?搞不懂 解决方案 阅读全文
posted @ 2024-10-29 16:17 叶乘风 阅读(370) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 error An unexpected error occurred: "EPERM: operation not permitted, unlink 'E:\\project\\项目名\\node_modules\\@rollup\\rollup-win32-x64-msvc\\rollup.win32-x64-msvc.node'"我正在给我的vue3+vite项目安装一个插件,运行安装命令报错: error An unexpected error occurred: "EPERM: operation not permitted, unlink 'E:\\project\\项目名\\node_modules\\@rollup 阅读全文
posted @ 2024-10-24 21:43 叶乘风 阅读(317) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 vue导入图片路径你是不是经常这么写: let arr = [ { src: "../../assets/good/1.png", } ] 然后你发现无法显示图片路径,那是因为你引入的图片路径方式不正确, 如果你的项目是由webpack或者vite构建,那么在导入图片路径的时候会有些许区别。 webpack: let 阅读全文
posted @ 2024-10-24 20:04 叶乘风 阅读(84) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 瀑布流(vue3)效果图: 代码: <template> <div id="waterfallContainer" class="waterfall-container"> <div v-for="(column, columnIndex) in columns" :key="columnIndex" class=" 阅读全文
posted @ 2024-10-24 17:45 叶乘风 阅读(238) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 常用重置网站样式/* 通用重置样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } /* 清除列表的默认样式 */ ul, ol { list-style: none; } /* 去除链接的默认下划线 */ a { text-decoration: n 阅读全文
posted @ 2024-10-24 14:33 叶乘风 阅读(6) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 A plugin must either be a function or an object with an &quot;install&quot; function.我在把一个组件注册到全局的时候遇到了这个警告,并且这个组件是没有生效的 原因:仅引用了组件的地址,最后使用app.user(组件),并没有给组件注册 解决方案:给组件注册,例如👇 import Item from "./index.vue"; Item.install = app => { app 阅读全文
posted @ 2024-10-24 14:30 叶乘风 阅读(226) 评论(0) 推荐(0) 编辑
摘要:2024-10-24 main.js:6 Uncaught TypeError: app is not a function ==》写法错误vue代码如下: // main.js import { createApp } from 'vue' import './style.css' import App from './App.vue' const app = createApp(App); app().mount('#app') 报 阅读全文
posted @ 2024-10-24 14:13 叶乘风 阅读(38) 评论(0) 推荐(0) 编辑
摘要:2024-10-18 arco-design的a-table的表字段无法显示值问题:arco-design的a-table的表字段number无法显示值 原因:该值不能作为表字段,number为特殊变量,不可用作dataIndex 解决方案:更换字段名即可,比如原来的是number,改成dataIndex: number2,然后在插槽里转换一下: <template #num 阅读全文
posted @ 2024-10-18 16:01 叶乘风 阅读(69) 评论(0) 推荐(0) 编辑
摘要:2024-10-16 前端图片加载方式优化(webp)把上传的图片文件格式转化为webp图片格式。 前置条件:图片文件存在阿里云oss。 阿里云的对象存储服务(OSS)支持在 URL 中直接指定图片处理参数,这样可以在不下载原始图片到服务器的情况下,直接由 OSS 服务端处理图片。 假设你有一张存在阿里云的图片链接,那么只需要在该链接的末尾加上?x-o 阅读全文
posted @ 2024-10-16 15:49 叶乘风 阅读(208) 评论(0) 推荐(0) 编辑
摘要:2024=10-15 arco-design之a-cascader多级下拉选中值时只显示最后一级名称==》format-label:format-label="format" 加上这个属性format-label:允许用户格式化展示内容 const format = (labels: any) => { return labels[labels.length - 1].label; } 注意你的数据结构 阅读全文
posted @ 2024-10-15 09:44 叶乘风 阅读(205) 评论(0) 推荐(0) 编辑
摘要:2024-10-11 自定义渲染之arco-design-vue table的columns的title ==》使用DOM插入子元素业务场景如下: 给表头插入一个必填的符号*,就这么简单的需求。 代码如下: const elements: any = document.querySelectorAll('.arco-table-th-title'); elements.forEach((a: any) => { const it 阅读全文
posted @ 2024-10-11 10:25 叶乘风 阅读(268) 评论(0) 推荐(0) 编辑
摘要:2024-10-10 js 深拷贝常用方法1、json序列化以及反序列化 let a = JSON.parse(JSON.stringify(b)) 2、使用lodash库插件 没有的话先安装: npm i lodash 使用方式: import { cloneDeep } from 'lodash'; let a = cloneDeep( 阅读全文
posted @ 2024-10-10 09:47 叶乘风 阅读(320) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示