摘要: 作用:可以实现在指定的位置预览PDF 缺点: (1)在iPad上只能预览一页PDF。(问题是iPad会将PDF转为img呈现,试了将img宽度设置为100%方法但并不好使) (2)在安卓上不能预览,依旧是下载。(问题是因为安卓浏览器不支持预览PDF,只能下载后用app打开) git地址 https: 阅读全文
posted @ 2021-06-08 11:11 shellon 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 问题:在VUE项目中,需要请求后台接口获取数据,这时往往会出现跨域问题 解决方法:在vue.config.js中devServer配置proxy 常用的场景 1. 请求/api/XXX现在都会代理到请求http://www.baidu.com/api/XXX,例如/api/login代理到请求htt 阅读全文
posted @ 2021-06-08 10:44 shellon 阅读(893) 评论(0) 推荐(0) 编辑
摘要: 问题:在vue项目中, 需要将标签上的icon换成自己所需的,发现在更换了public/favicon.ico后,没有生效,依旧是原来Vue的icon。 解决办法:在vue.config.js中,修改pwa配置 代码 module.exports = { pwa: { iconPaths: { fa 阅读全文
posted @ 2021-06-07 17:06 shellon 阅读(1169) 评论(0) 推荐(0) 编辑
摘要: 效果图 实现思路 编辑一个svg文件,可以自定义线条颜色和粗细。 将svg文件转为base64格式,作为背景图属性设置。 svg转base64的网址:https://www.sojson.com/image2base64.html 实现代码 # line.svg <svg xmlns="http:/ 阅读全文
posted @ 2021-06-07 15:08 shellon 阅读(910) 评论(0) 推荐(0) 编辑
摘要: 需求 针对list中某个字段,实现list的升序和降序 效果图 代码 我是用在angular1.X中项目的,根据list中的sort字段进行排序。 # sort.html <style> .list-sort .upper-sort { width: 0; height: 0; margin-bot 阅读全文
posted @ 2021-06-07 14:50 shellon 阅读(1112) 评论(0) 推荐(0) 编辑
摘要: 用途 图片预览,支持多图片滑动预览 git 地址 https://github.com/sachinchoolur/lightgallery.js 代码 # idnex.html <script src="js/lightGallery.js"></script> # imagePreview.ht 阅读全文
posted @ 2021-06-07 14:36 shellon 阅读(569) 评论(0) 推荐(0) 编辑
摘要: type属性值 hidden: 隐藏. text:文本 search:搜索 tel url email password:密码 date:日期选择器 month:月份选择器 week:周选择器 time:时间选择器 datetime-local:日期时间选择器 number:数字。 range:范围 阅读全文
posted @ 2021-06-07 13:48 shellon 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 实现功能 能够在移动设备上实现电子签名,并保存为图片 git地址 https://github.com/szimek/signature_pad 参数说明 dotSize:点的大小(在屏幕上点击留下的点大小,单位:px) minWidth: 线的最小宽度(单位:px,默认:0.5) maxWidth 阅读全文
posted @ 2021-06-07 13:17 shellon 阅读(1686) 评论(0) 推荐(0) 编辑
摘要: 需求背景 数据表格有时需要增加导出Excel功能,大多数情况下都是后端出下载接口,前端去调用。 对于数据量少的数据,可以通过前端技术实现,减少后端工作。 实现方式 使用插件——xlsx 根据自己项目情况,定义通用的导出方法 代码 xlxs git地址https://github.com/SheetJ 阅读全文
posted @ 2021-05-31 17:10 shellon 阅读(2104) 评论(0) 推荐(1) 编辑
摘要: 场景 项目中打包遇到了点问题,所以想删除原先装好的依赖包,重新yarn,结果神奇的报错了,无语。。。 遇到的问题 (1)error An unexpected error occurred: "https://raw.githubusercontent.com/seonim-ryu/Squire/f 阅读全文
posted @ 2021-04-26 09:50 shellon 阅读(2263) 评论(0) 推荐(0) 编辑