HTLF

一步一个脚印,走出高度...

导航

统计

随笔分类 -  前端开发

vue+ts项目常见问题及解决方案
摘要:无法找到模块@/views/Login.vue的声明文件。 错误的原因:typescript 不能识别 .vue 文件 解决方法: 在项目vite-env.d.ts文件中添加以下代码 declare module '*.vue' { import { ComponentOptions } from 阅读全文

posted @ 2025-03-05 10:51 HTLF 阅读(0) 评论(0) 推荐(0) 编辑

vue前端,获取数据,打包压缩包下载
摘要:// 最好是定义一个表个通用数据,循环得到相关数据 const tableHeader = ref([ { header: '订单', key: 'index', width: 24 }, { header: '编号', key: 'number', width: 100 }, { header: 阅读全文

posted @ 2025-02-12 16:52 HTLF 阅读(7) 评论(0) 推荐(0) 编辑

A页面跳转到B页面,不正常显示问题
摘要:需要再head标签体中添加 meta 标签 <meta name="referrer" content="no-referrer"/> 阅读全文

posted @ 2025-02-12 09:53 HTLF 阅读(0) 评论(0) 推荐(0) 编辑

vue 基于exceljs导出Excle
摘要:安装依赖 exceljs插件 file-saver下载插件 npm i exceljs npm i file-saver 引用 import * as ExcelJS from 'exceljs' import FileSaver from 'file-saver' 使用 // 设置标题列 cons 阅读全文

posted @ 2025-01-16 15:25 HTLF 阅读(6) 评论(0) 推荐(0) 编辑

前端vue3使用cropperjs截图插件
摘要:安装 npm install cropperjs@next 使用 <img ref="uploadImg" src="/cropperjs/v2/picture.jpg" alt="Picture"> // 引入 import Cropper from 'cropperjs'; // 样式 impo 阅读全文

posted @ 2024-09-27 14:44 HTLF 阅读(479) 评论(0) 推荐(0) 编辑

常见css属性方法
摘要:上下拉动滚动条时卡顿、慢 body { -webkit-overflow-scrolling: touch; overflow-scrolling: touch; } 禁止复制、选中文本 Element { -webkit-user-select: none; -moz-user-select: n 阅读全文

posted @ 2024-09-27 10:37 HTLF 阅读(7) 评论(0) 推荐(0) 编辑

CSS样式,鼠标移入,底部线条两边延长效果
摘要:a{ text-decoration: none; } .post-title-link { color: #3F51B5; position: relative; display: inline-block } .post-title-link::after { content: ""; posi 阅读全文

posted @ 2024-09-25 15:29 HTLF 阅读(21) 评论(0) 推荐(0) 编辑

使用`xlsx-js-style`插件导出表格,并添加样式导出
摘要:安装 npm install xlsx-js-style --save 使用 引入 import XLSX from 'xlsx-js-style' // 最好是定义一个表个通用数据,循环得到相关数据 const tableHeader = [ { header: '序号', key: 'index 阅读全文

posted @ 2024-09-21 17:56 HTLF 阅读(242) 评论(0) 推荐(0) 编辑

vue 项目读取本地Excel方法
摘要:安装插件xlsx npm install xlsx 在需要的页面引入插件 import * as xlsx from 'xlsx' 使用xlsx读取excel文件 点击上传Excel文件 <template> <!-- 上传按钮 --> <el-upload action="#" :auto-upl 阅读全文

posted @ 2024-09-20 17:02 HTLF 阅读(395) 评论(0) 推荐(0) 编辑

vue项目记录每个页面保持滚动条的位置
摘要:路由元信息 增加keepAlive:true , scrollTop: {top: 0} , { path: '/**/**', name: '**', component: () => import('@/views/**/index.vue'), meta: { title: '**', aff 阅读全文

posted @ 2024-09-19 16:52 HTLF 阅读(154) 评论(0) 推荐(0) 编辑

vue项目“不使用TS”开发 常见文件处理
摘要:使用vue自带的方法,如watchEffect() 提示'watchEffect' is not defined.eslint 解决办法,在.eslintrc.cjs文件中添加以下代码 module.exports = { root: true, extends: [ ... 'plugin:vit 阅读全文

posted @ 2024-08-29 16:43 HTLF 阅读(16) 评论(0) 推荐(0) 编辑

css框架之windicss
摘要:官网地址 windicss 安装 执行命令 npm i -D vite-plugin-windicss windicss 在vite.config.js中配置 //引入 import WindiCSS from 'vite-plugin-windicss' //使用 plugins:[ WindiC 阅读全文

posted @ 2024-08-26 01:04 HTLF 阅读(50) 评论(0) 推荐(0) 编辑

jQuery 事件对象
摘要:## 1.1. jQuery 事件注册 ​ jQuery 为我们提供了方便的事件注册机制,是开发人员抑郁操作优缺点如下: - 优点: 操作简单,且不用担心事件覆盖等问题。 - 缺点: 普通的事件注册不能做事件委托,且无法实现事件解绑,需要借助其他方法。 **语法** ```js //语法 eleme 阅读全文

posted @ 2023-07-03 16:42 HTLF 阅读(30) 评论(0) 推荐(0) 编辑

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