2025年2月18日
摘要: 安装"unplugin-auto-import"插件,在vite.config.ts中配置该插件以自动生成auto-imports.d.ts文件 例如: 然后执行npm run dev,会自动在项目根目录下生成auto-imports.d.ts文件‌; 阅读全文
posted @ 2025-02-18 17:20 久闻 阅读(73) 评论(0) 推荐(0)
摘要: axios({ url: `url`, method: "post", data: { 参数... }, responseType: "blob", }) .then((res)=>{ const elink = document.createElement("a"); const fileName 阅读全文
posted @ 2025-02-18 16:08 久闻 阅读(24) 评论(0) 推荐(0)
2024年2月26日
摘要: 导出: const formElement = document.createElement('form');formElement.style.display = 'display:none;';formElement.method = 'post';formElement.action = wi 阅读全文
posted @ 2024-02-26 17:14 久闻 阅读(29) 评论(0) 推荐(0)
摘要: 下载: axios({ url: `url`, method: "post", data: { 参数... }, responseType: "blob", }) .then((res)=>{ const link = document.createElement("a"); let blob = 阅读全文
posted @ 2024-02-26 16:39 久闻 阅读(104) 评论(0) 推荐(0)
2023年3月8日
摘要: 1、encodeURIComponent() 函数对 URI 组件进行编码。 2、decodeURIComponent() 函数对编码的 URI 组件进行解码。 例: let uri = "https://www.baidu.com/"; let uri_enc = encodeURICompone 阅读全文
posted @ 2023-03-08 17:03 久闻 阅读(40) 评论(0) 推荐(0)
2022年9月15日
摘要: npm install xxx --save 命令是安装模块到项目node_modules目录下,会将模块依赖写入package.json文件中的dependencies{}下。如果将node_modules目录删除,使用npm install安装所有依赖,包括自行安装的依赖(如axios),会被自 阅读全文
posted @ 2022-09-15 19:58 久闻 阅读(2310) 评论(0) 推荐(1)
摘要: npm install js-file-download --savenpm install axios --save import axios from "axios"; import fileDownload from "js-file-download"; export const expor 阅读全文
posted @ 2022-09-15 19:22 久闻 阅读(1123) 评论(0) 推荐(0)
2022年8月10日
摘要: 一、通过后端返回数据,前端自行创建表格导出: 1. 在前端HTML上绘制想要导出的表格(包含后端获取的数据) <div class="exportExcel" id="exportOutTable" style="display:none"> <table></table> </div> 2. 导出 阅读全文
posted @ 2022-08-10 10:17 久闻 阅读(756) 评论(0) 推荐(0)
2022年7月21日
摘要: resolve是router的一个方法, 返回路由地址的标准化版本。该方法适合编程式导航。 let router = this.$router.resolve({ path: '/home', query:{ id:item.id } }) window.open(router.href,'_bla 阅读全文
posted @ 2022-07-21 11:20 久闻 阅读(3748) 评论(0) 推荐(0)
2022年7月17日
摘要: 1. Object.assign()方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象,它将返回目标对象。 语法: Object.assign(target, ...sources) 参数: target目标对象。sources源对象。 var obj = { a: 1 }; var co 阅读全文
posted @ 2022-07-17 16:22 久闻 阅读(690) 评论(0) 推荐(0)