10 2024 档案
摘要:
dayjs获取周一代码为: dayjs().startOf('week').format('YYYY-MM-DD') 但是为什么获取到的周一日期为27呢? 原因:startOf('week')默认认为周日是一周开始的第一天,而不是周一才是第一天 嗯.......国外第一天都是周日吗?搞不懂 解决方案
阅读全文

摘要:
我正在给我的vue3+vite项目安装一个插件,运行安装命令报错: error An unexpected error occurred: "EPERM: operation not permitted, unlink 'E:\\project\\项目名\\node_modules\\@rollup
阅读全文

摘要:
你是不是经常这么写: let arr = [ { src: "../../assets/good/1.png", } ] 然后你发现无法显示图片路径,那是因为你引入的图片路径方式不正确, 如果你的项目是由webpack或者vite构建,那么在导入图片路径的时候会有些许区别。 webpack: let
阅读全文

摘要:
效果图: 代码: <template> <div id="waterfallContainer" class="waterfall-container"> <div v-for="(column, columnIndex) in columns" :key="columnIndex" class="
阅读全文

摘要:
/* 通用重置样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } /* 清除列表的默认样式 */ ul, ol { list-style: none; } /* 去除链接的默认下划线 */ a { text-decoration: n
阅读全文

摘要:
我在把一个组件注册到全局的时候遇到了这个警告,并且这个组件是没有生效的 原因:仅引用了组件的地址,最后使用app.user(组件),并没有给组件注册 解决方案:给组件注册,例如👇 import Item from "./index.vue"; Item.install = app => { app
阅读全文

摘要:
vue代码如下: // main.js import { createApp } from 'vue' import './style.css' import App from './App.vue' const app = createApp(App); app().mount('#app') 报
阅读全文

摘要:
问题:arco-design的a-table的表字段number无法显示值 原因:该值不能作为表字段,number为特殊变量,不可用作dataIndex 解决方案:更换字段名即可,比如原来的是number,改成dataIndex: number2,然后在插槽里转换一下: <template #num
阅读全文

摘要:
把上传的图片文件格式转化为webp图片格式。 前置条件:图片文件存在阿里云oss。 阿里云的对象存储服务(OSS)支持在 URL 中直接指定图片处理参数,这样可以在不下载原始图片到服务器的情况下,直接由 OSS 服务端处理图片。 假设你有一张存在阿里云的图片链接,那么只需要在该链接的末尾加上?x-o
阅读全文

摘要:
:format-label="format" 加上这个属性format-label:允许用户格式化展示内容 const format = (labels: any) => { return labels[labels.length - 1].label; } 注意你的数据结构
阅读全文

摘要:
业务场景如下: 给表头插入一个必填的符号*,就这么简单的需求。 代码如下: const elements: any = document.querySelectorAll('.arco-table-th-title'); elements.forEach((a: any) => { const it
阅读全文

摘要:
1、json序列化以及反序列化 let a = JSON.parse(JSON.stringify(b)) 2、使用lodash库插件 没有的话先安装: npm i lodash 使用方式: import { cloneDeep } from 'lodash'; let a = cloneDeep(
阅读全文
